pip-即使成功安装,也没有名为"pip"的模块 [英] pip - No module named 'pip' even after successful installation

查看:171
本文介绍了pip-即使成功安装,也没有名为"pip"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 10系统上安装pip.我得到了get-pip.py文件并运行了命令

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

这是终端的快照

$ 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

我明白了-

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'

为什么会这样?它只是说pip已成功安装,当我尝试查看该版本以检查其是否已安装时,它说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'

此外,我在PATH变量中包含了C:/Program/Files/Python/python3/Scripts.

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

请帮助! ! ! !

Please help ! ! ! !

推荐答案

运行python get-pip.py后,python install-dir将增加dir Lib \ site-packages

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

方法1.尝试将pip目录cp到python install-dir

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

方法2.在python install-dir中更改文件python3x._pth,将这一行附加到Lib \ site-packages

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

运行点,问题将得到解决

run pip, problem will be solved

这篇关于pip-即使成功安装,也没有名为"pip"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆