简体   繁体   中英

debian python pip errors

After trying to install the client onedrive-d with a script from github this error when accessing any python components. Maybe it's because of the multiple versions of python installed at the same time. How to correctly remove one?

Errors:

 root@root:~# 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)

root@root:/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

root@root:/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

root@ns325364:/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

Quick fix is that you could specify the full path of Python you want to use ie

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

Your python path may not be in /usr/bin. To check where it is, use which python . -m flag means module.

I would recommend you to remove all Python altogether (via apt-get remove --purge ) and reinstall the version you really need

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM