我尝试运行一个导入Pandapower库的程序,并得到了错误:
NameError: name 'TextPath' is not defined我通过pip安装了Pandapower,它运行良好,但是它似乎与"pandapower.plotting.collections“和类"class CustomTextPath(TextPath):”有问题。
最低限度守则:
import pandapower as pp
import pandapower.plotting as plotTracebacK:Traceback (most recent call last): File "-\Test.py", line 2, in <module> import pandapower.plotting as plot File "-\Python\Python310\lib\site-packages\pandapower\plotting\__init__.py", line 1, in <module> from pandapower.plotting.collections import * File "-\Python\Python310\lib\site-packages\pandapower\plotting\collections.py", line 36, in <module> class CustomTextPath(TextPath): NameError: name 'TextPath' is not defined
发布于 2022-06-21 20:43:12
这是pandapower中的一个bug。它们依赖于安装matplotlib。代码在try/except中捕捉到它的缺失,但仍然尝试使用它将导入的元素。所以,做一个pip install matplotlib,你应该是好的。
https://stackoverflow.com/questions/72706742
复制相似问题