2017-02-24 68 views
0

在嘗試使用github腳本安裝客戶端onedrive-d時,訪問任何python組件時出現此錯誤。 也許是因爲同時安裝了多個python版本。如何正確刪除一個?debian python pip錯誤

錯誤:

[email protected]:~# pip 
    Traceback (most recent call last): 
     File "/usr/local/bin/pip", line 9, in <module> 
     load_entry_point('pip==9.0.1', 'console_scripts', 'pip')() 
     File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in load_entry_point 
     return get_distribution(dist).load_entry_point(group, name) 
     File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in load_entry_point 
     return ep.load() 
     File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load 
     entry = __import__(self.module_name, globals(),globals(), ['__name__']) 
     File "/usr/local/lib/python3.2/dist-packages/pip-9.0.1-py3.2.egg/pip/__init__.py", line 21, in <module> 
     from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning 
     File "/usr/local/lib/python3.2/dist-packages/pip-9.0.1-py3.2.egg/pip/_vendor/requests/__init__.py", line 66, in <module> 
     from .models import Request, Response, PreparedRequest 
     File "/usr/local/lib/python3.2/dist-packages/pip-9.0.1-py3.2.egg/pip/_vendor/requests/models.py", line 856 
     http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url) 

[email protected]:/usr/local/bin# ls -l | grep pip 
-rwxr-xr-x 1 root staff 282 Feb 24 19:28 pip 
-rwxr-xr-x 1 root staff 284 Feb 24 19:28 pip3 
-rwxr-xr-x 1 root staff 288 Feb 24 19:28 pip3.2 

[email protected]:/usr/lib# ls -l | grep pythonlrwxrwxrwx 1 root root  35 Feb 21 2013 libpyglib-gi-2.0-python3.2.so -> libpyglib-gi-2.0-python3.2.so.0.0.0 
lrwxrwxrwx 1 root root  35 Feb 21 2013 libpyglib-gi-2.0-python3.2.so.0 -> libpyglib-gi-2.0-python3.2.so.0.0.0 
-rw-r--r-- 1 root root 16200 Feb 21 2013 libpyglib-gi-2.0-python3.2.so.0.0.0 
lrwxrwxrwx 1 root root  39 Feb 20 2013 libpython3.2mu.a -> python3.2/config-3.2mu/libpython3.2mu.a 
lrwxrwxrwx 1 root root  19 Feb 20 2013 libpython3.2mu.so -> libpython3.2mu.so.1 
lrwxrwxrwx 1 root root  21 Feb 20 2013 libpython3.2mu.so.1 -> libpython3.2mu.so.1.0 
-rw-r--r-- 1 root root 3339136 Feb 20 2013 libpython3.2mu.so.1.0 
drwxr-xr-x 3 root root 4096 Oct 10 2012 python2.6 
drwxr-xr-x 26 root root 20480 Jan 21 11:10 python2.7 
drwxr-xr-x 3 root root 4096 Oct 10 2012 python3 
drwxr-xr-x 31 root root 12288 Feb 24 19:21 python3.2 

[email protected]:/usr/local/lib# ls -l | grep python 
drwxrwsr-x 4 root staff 4096 Jan 21 11:10 python2.7 
drwxrwsr-x 3 root staff 4096 Feb 24 19:21 python3.2 

回答

0

快速的解決方法是,你可以指定的Python的完整路徑要使用即

  1. 對於Python 2.7:/usr/bin/python2.7 -m pip ...(cont.)
  2. 對於Python 3.2:/usr/bin/python3.2 -m pip ...(cont.)

您的python路徑可能不在/ usr/bin中。要檢查它在哪裏,請使用which python-m標誌表示模塊。

我建議你乾脆刪除所有的Python(通過apt-get remove --purge),並重新安裝的版本,你真的需要