Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip - No module named 'pip' even after successful installation

I am trying to install pip on my Windows 10 system. I got the get-pip.py file and ran the command

python get-pip.py

Here's a snapshot of the terminal

$ python get-pip.py
Collecting pip
Using cached 
https://files.pythonhosted.org/packages/46/dc/7fd5df840e
fb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2
.py3-none-any.whl
Collecting setuptools
  Using cached 
https://files.pythonhosted.org/packages/ff/47/1dfa4795e
24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3- 
none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-19.0.1 setuptools-40.8.0 wheel-0.32.3

Now when I try to check the version with

pip -V

I get this -

Traceback (most recent call last):
 File "runpy.py", line 193, in _run_module_as_main
 File "runpy.py", line 85, in _run_code
 File "C:\Program Files\Python\python-3.6.3-embed- 
 amd64\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'

Why is this happening? It JUST said pip installed successfully and when I try to see the version to check if its installed, it says No module named 'pip'

Also, I have included C:/Program/Files/Python/python3/Scripts in the PATH variable.

Please help ! ! ! !

like image 211
Krithika Raghavendran Avatar asked Feb 08 '19 04:02

Krithika Raghavendran


3 Answers

After running python get-pip.py, python install-dir will increase dir Lib\site-packages

Method 1. try to cp the pip dir into the python install-dir

or

Method 2. change file python3x._pth in python install-dir,append this line Lib\site-packages

run pip, problem will be solved

like image 62
demianzhang Avatar answered Nov 05 '22 07:11

demianzhang


The following steps may be followed to install pip on windows:

  1. Download python file: get-pip.py (nearly 1.8 MB size) from link: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py and save it to your desktop
  2. Go to command prompt and Check your python version: c:> python
  3. From command prompt run: c:> python get-pip.py
  4. The above will install new version of pip. check by running C:> pip --version
  5. You may also update setup tools - C:> pip install --upgrade pip setuptools
like image 22
Hanumanth s Avatar answered Nov 05 '22 05:11

Hanumanth s


  • Open python37._pth file which is in the root folder of python.
  • Add Lib\site-packages line.

All will work fine.

like image 32
mifth Avatar answered Nov 05 '22 05:11

mifth