我正在使用python 3.6。 Pip与python一起安装。好像pip似乎没有出现。试过这里可用的各种解决方案没有用。请帮我解决这个问题。
已完成验证
路径设置为C:\Program Files\Python36\Scripts
添加了所有3
PIP错误:
C:\Users\>pip
Traceback (most recent call last):
File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python36\Scripts\pip.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'main'
尝试过的解决方案:
pip install --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org {package name}
C:\Users\>pip
Traceback (most recent call last):
File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python36\Scripts\pip.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'main'
C:\Users>python3 -m pip uninstall pip setuptools
'python3' is not recognized as an internal or external command,
operable program or batch file.
C:\Users>python
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python3 -m pip uninstall pip setuptools
File "<stdin>", line 1
python3 -m pip uninstall pip setuptools
^
SyntaxError: invalid syntax
>>> python3 -m pip uninstall pip setuptools
File "<stdin>", line 1
python3 -m pip uninstall pip setuptools
^
SyntaxError: invalid syntax
>>> pip install --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org {package name}
File "<stdin>", line 1
pip install --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org {package name}
^
SyntaxError: invalid syntax
>>>
使用以下版本
C:\Users\>python
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
答案 0 :(得分:0)
尝试使用
pip2
对于python 2.和
pip3
对于python 3
从管理员cmd行开始。
答案 1 :(得分:0)
检查是否已添加这些目录的路径(如果您使用的是python3.x版本) - C:\ Users \ tojose \ AppData \ Local \ Programs \ Python \ Python3.x和pip C:\ Users \ tojose \ AppData \ Local \ Programs \ Python \ Python3.x \ Scripts as pip * .exe&#39; s 存储在这里。
答案 2 :(得分:0)
尝试使用pip
和您要安装的软件包的完整路径。
示例(对于Python 3.6):
C:\ Python36 \ Scripts \ pip install C:\ Python36 \ requests-2.18.4-py2.py3-none-any.whl
答案 3 :(得分:0)
在Windows 10上,我遇到了同样的问题。 PIP 19
已安装在我的系统中,但未显示。错误为No Module Found
。
python -m pip uninstall pip
python -m pip install pip==9.0.3
将pip
降级为9.0.3对我来说很好。
我已经回答了HERE
答案 4 :(得分:0)