Python no module named pip

Viewed 8913

I use windows 7 32 bit and python 3.7. I was trying to install a module with pip and this error came up:

C:\Windows\System32>pip install pyttsx3
Traceback (most recent call last):
  File "d:\python\python 3.7\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\python\python 3.7\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Python\Python 3.7\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'

Does anybody know how to fix this?

5 Answers

Make sure you have python path added to the PATH variable. Then run

python -m ensurepip

Could you try?

pip3 install pyttsx3

Start Python Setup again (Download from here) and be sure to tick that Add python to PATH at the bottom of installation.

  1. Download get-pip.py to a folder on your computer.

  2. Open a command prompt and navigate to the folder containing the get-pip.py installer.

  3. Run the following command:

    python get-pip.py

  4. 4-) Verify Installation and Check the Pip Version:

    pip -V

To me for Ubuntu 20.04 helped the following:

ls -al /usr/bin/python # check before removal that 'python' is link
sudo rm /usr/bin/python # remove link to old version of python
sudo ln -s /usr/bin/python3.8 /usr/bin/python # create new link to actual python version
sudo apt install python3-pip # install missing pip

"Python: No module named pip" was because of missing python3-pip.

Related