Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

name 'TextPath' is not defined

I’ve tried running a program which imports the Pandapower library, and I get the Error:

NameError: name 'TextPath' is not defined

I installed Pandapower via pip install normally, and it works good, but it seems to have Problems with "pandapower.plotting.collections" and the class "class CustomTextPath(TextPath):"

Minimal Code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import pandapower as pp

import pandapower.plotting as plot

TracebacK:
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

>Solution :

This is a bug in pandapower. They depend on having matplotlib installed. The code catches its absence with a try/except but still tries to use the elements it would have imported. So, do a pip install matplotlib and you should be good.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading