Cpython engine CPY385 - Matplotlib import #1684
Labels
Closed Old Issue
Issue older than a year. Thanks for pointing it out. If you feel it is still relevant, feel free to
Python 3
Issues related to cpython engines [subsystem]
Describe the bug
I have installed pyRevit but I am getting a small bug when Revit starts and pyRevit loads. I am not sure if it can be related, so I will present that bug.
The first issue importing matplolib import is related to the site-package pyparsing.
ImportError : Matplotlib requires pyparsing>=2.2.1; you have 2.2.0
But actually, when I install Matplotlib, it also installs the latest site-package pyparsing3.0.9. However, pyRevit has the site-package pyparsing2.2.0 installed by default, and that one is automatically considered even if pyparsing3.0.9 is available on the site-package folder of python.
Let's see how it works:
CPython Traceback:
Now, manually removing the site-package pyparsing from the pyRevit-master directory, and extending the code a bit more to include more libraries (numpy, pandas, scipy):
Now, we can see that the pyparsing version is 3.0.9 because cpython engine does not find the package installed by default on the site-package folder from pyRevit. In addition I can see that packages are being loaded from the right place (previously defined as PYTHONPATH environment variable).
The problems come when I try to import matplotlib.
I have looked for help, and I've found a similar issue in matplotlib GitHub
However, in my case, I don't think that the root cause sits in something else in the system because I've tried
import matplotlib
from the Python shell 3.8.5, which works well in that case.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: