1
有沒有人處於相同的情況?安裝pip後沒有名爲'pip'的模塊
$ which pip
/usr/local/bin/pip
$pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
ModuleNotFoundError: No module named 'pip'
$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> pip.__version__
'9.0.1'
同樣的情況發生在其他包
$ easy_install
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 7, in <module>
from setuptools.command.easy_install import main
ModuleNotFoundError: No module named 'setuptools'
$ virtualenv
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 7, in <module>
from virtualenv import main
ModuleNotFoundError: No module named 'virtualenv'
它們都安裝。
的Ubuntu 16.04的Python 2
請嘗試'python -m pip install PACKAGENAME'並告訴我們,如果它工作 – Michal
它的工作原理,你能告訴我爲什麼嗎? – ycd
它接縫是路徑問題。我現在不是在用我的Linux電腦,但在晚上我會嘗試一些並回答,如果沒有其他人會這樣做的話 – Michal