I can't use pip and I don't know why. The error I get is shown below:
File "d:\python\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\python\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\Python\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'
If I try py -3.8 -m pip install
I get
D:\Python\python.exe: No module named pip
.
If I use get-pip nothing happens.
If I try to upgrade pip nothing happens.
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.
While this error can come due to multiple reasons but in most of the cases you will see this error because of pip package not installed in your System. So to solve this kind of error, you need to simply install pip package from the default Repo.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!
Try
python -m ensurepip
This command activates pip.
Ref. https://docs.python.org/3/library/ensurepip.html
After this you can upgrade
python -m pip install --upgrade pip
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