Home > Blockchain >  No module named pip after installing pip
No module named pip after installing pip

Time:07-29

I'm trying to download gzip and pip was outdated. I type the following:

C:\Users\username>py get-pip.py

And then I checked if the pip was updated:

C:\Users\username>pip --version
pip 22.2.1 from C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip (python 3.8)

But when I tried again to pip install, I got the following error message:

C:\Users\username>py -m pip install "gzip"
C:\ProgramData\Anaconda3\python.exe: No module named pip

I think I have two versions of Python and I don't know if I should delete one or not (3.8 and 3.6.1).

C:\Users\username>py --version
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)

Any help is appreciated!

CodePudding user response:

First of all, gzip is part of the standard library. Doesn't need installed.


py command on your PATH is coming from Anaconda. You should be able to use conda install, then instead.

You have two different installations of Python on your system. The one from the App Store (Python 3.8, which has pip), and the one from Anaconda (Python 3.6) which does not.

Ideally, you should keep/upgrade Anaconda, as it is more feature-rich, depending on your needs, and uninstall the other.

CodePudding user response:

This means pip is not installed on the python environment you are trying to access. So in order to access a specific version of python you can try something like this:

Python 3.6.1

python3.6 -m pip --version

Python 3.8

python3.8 -m pip --version

This should allow you to access a specific version of python and see which instance pip is being installed to.

  • Related