python新手,会一点点基础的语法但不多。
最近由于工作需要,在研究一个python第三方库‘gdspy’
最开始我以为是我没安装成功,因为pip list,没有出现gdspy

在GitHub上找到了这个库的docs里面的一个示例代码,
提示有bug,报错
import gdspy
# The GDSII file is called a library, which contains multiple cells.
lib = gdspy.GdsLibrary()
# Geometry must be placed in cells.
cell = lib.new_cell('FIRST')
# Create the geometry (a single rectangle) and add it to the cell.
rect = gdspy.Rectangle((0, 0), (2, 1))
cell.add(rect)
# Save the library in a file called 'first.gds'.
lib.write_gds('first.gds')
# Optionally, save an image of the cell as SVG.
cell.write_svg('first.svg')
# Display all cells using the internal viewer.
gdspy.LayoutViewer()
File "C:\Users\42\untitled1.py", line 11, in <module>
lib = gdspy.GdsLibrary()
AttributeError: module 'gdspy' has no attribute 'GdsLibrary'

不知道哪里有问题,请教一下巨佬们这种情况应该如何解决?是我gdspy的版本和python版本不兼容?
版本信息:gdspy——1.6.2,spyder(python3.9)。


