I am trying to plot some data using matplotlib. When importing the library, I get the error:
ImportError: matplotlib requires pyparsing
I installed pyparsing using easy_install pyparsing
, but the error keeps appearing.
How can I solve this problem? Alternatively, is there any alternative to matplotlib to plot stuff with Python?
Edit: sys.path
returns:
['', 'C:\\Python27\\lib\\site-packages\\spyderlib\\utils\\external', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\lib\\site-packages\\Orange\\orng', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\win32', 'C:\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\Python27\\lib\\site-packages\\IPython\\extensions']
Trying to import pyparsing returns the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "C:/Python27/Lib/site-packages/xy/simulation.py", line 4, in <module>
import pyparsing
ImportError: No module named pyparsing
For me, a previous egg installation screwed things. I just did:
pip uninstall pyparsing
pip install pyparsing
And that fixed the dependency resolution.
pip install pyparsing
was NOT working for me. pyparsing must come with python. Reinstalling the python and pip worked for me.
For what it's worth you could also try installing via pip if you have it. Quick link if you need an install script: Stackoverflow post. Anyways, then just use:
pip install pyparsing
apt-get remove python-pip
apt-get install build-essential libssl-dev libffi-dev python-dev
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
apt-get install python-pip
pip install cffi
These steps resolved the basic "pip --version" errors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With