I tried installing/uninstalling pyparsing as well and it does not work. I am stuck with this and I have to install additional libraries as well.
Here is the error message:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/home/rachana/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/home/rachana/.local/lib/python2.7/site-packages/packaging/requirements.py", line 9, in <module>
from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
ImportError: No module named pyparsing
How can I fix this?
The Python "ModuleNotFoundError: No module named 'pip'" occurs when pip is not installed in our Python environment. To solve the error, install the module by running the python -m ensurepip --upgrade command on Linux or MacOS or py -m ensurepip --upgrade on Windows.
The Python "ImportError: No module named 'typing'" occurs when we use an outdated version of pip . To solve the error, run the python -m pip install --upgrade pip command and install the typing module by running pip install typing .
Method 1: pip show. To check which version of the Python library pyparsing is installed, run pip show pyparsing or pip3 show pyparsing in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu).
The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The pyparsing module provides a library of classes that client code uses to construct the grammar directly in Python code.
I'm had the same problem and resolved it. Here is you can see that pip not working properly (without any additional parameters).
root@notebook:/home/ci# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 9, in <module>
from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
Okay, so first that we may do is installing broken dependency:
wget https://pypi.python.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz
gunzip pyparsing-2.2.0.tar.gz
tar -xvf pyparsing-2.2.0.tar
cd pyparsing-2.2.0 && python setup.py install
After it mising dependency will be installed from sources.
Trying to using pip one more time:
[email protected]:/tmp/pyparsing-2.2.0# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 74, in <module>
import appdirs
ImportError: No module named appdirs
This is the next problem. And you can fix it more quickly:
root@notebook:/home/ci# python -m pip install appdirs
Downloading/unpacking appdirs
Downloading appdirs-1.4.3-py2.py3-none-any.whl
Installing collected packages: appdirs
Successfully installed appdirs
Cleaning up...
After that my pip was successfully repaired. Kind regards.
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