Reputation: 457
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 ! ! ! !
Upvotes: 11
Views: 33106
Reputation: 355
py -m ensurepip --upgrade
this is work for me official docs link you can try multiple methods based on os. https://pip.pypa.io/en/stable/installation/
Upvotes: 2
Reputation: 121
I suggest referring to the pip homepage: https://pip.pypa.io/en/stable/installation/ It describes all methods on how to install pip. I am a win10 user so the solution was to run this command:
py -m ensurepip --upgrade
Upvotes: 5
Reputation:
If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip’s maintainers:
ensurepip
get-pip.py
Method 1
ensurepip Python comes with an ensurepip module1, which can install pip in a Python environment.
Linux: python -m ensurepip --upgrade
MacOc: python -m ensurepip --upgrade
Windows: py -m ensurepip --upgrade
Method 2
get-pip.py This is a Python script that uses some bootstrapping logic to install pip.
Download the script, from https://bootstrap.pypa.io/get-pip.py.
Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:
Linux: python get-pip.py
MacOc: python get-pip.py
Windows: py get-pip.py
Above installation commands are in official python
link.
Optional
After successful installation of pip
you might want to upgrade pip
to latest version
for Linux and MacOs python -m pip install --upgrade pip
for Windows : py -m pip install --upgrade pip
Upvotes: 0
Reputation: 292
Lib\site-packages
line.All will work fine.
Upvotes: 11
Reputation: 101
The following steps may be followed to install pip on windows:
Upvotes: 5
Reputation: 1
I found files in my Windows lib\site-packages directory ~ip ~ip-20-0.2.dist-info
Renamed them to pip pip-20-0.2.dist-info
And it worked to run pip install --upgrade pip
Upvotes: 0
Reputation: 1
Use following commands can be used to find out whether pip extraction path is included or not.
>>> import sys
>>> sys.path
if Lib\site-packages
path is not included then update file python37._pth
.
Run the command again and path should be visible.
pip install <module name>
worked successfully for me after this.
Thanks @demianzhang for the hint or even for the solution.
Upvotes: 0
Reputation: 634
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
Upvotes: 20