How do I fix 'ImportError: cannot import name IncompleteRead'?

前端 未结 16 1167
暖寄归人
暖寄归人 2020-11-28 18:22

When I try to install anything with pip or pip3, I get:

$ sudo pip3 install python3-tk
Tra         


        
相关标签:
16条回答
  • 2020-11-28 19:04

    On Ubuntu 14.04 I resolved this by using the pip installation bootstrap script, as described in the documentation

    wget https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py
    

    That's an OK solution for a development environment.

    0 讨论(0)
  • 2020-11-28 19:04

    This should work for you. Follow these simple steps.

    First, let's remove the pip which is already installed so it won't cause any error.

    Open Terminal.

    Type: sudo apt-get remove python-pip

    It removes pip that is already installed.

    Method-1

    Step: 1 sudo easy_install -U pip

    It will install pip latest version.

    And will return its address: Installed /usr/local/lib/python2.7/dist-packages/pip-6.1.1-py2.7.egg

    or

    Method-2

    Step: 1 go to this link.

    Step: 2 Right click >> Save as.. with name get-pip.py .

    Step: 3 use: cd to go to the same directory as your get-pip.py file

    Step: 4 use: sudo python get-pip.py

    It will install pip latest version.

    or

    Method-3

    Step: 1 use: sudo apt-get install python-pip

    It will install pip latest version.

    0 讨论(0)
  • 2020-11-28 19:06

    The problem is the Python module requests. It can be fixed by

    $ sudo apt-get purge python-requests
    [now requests and pip gets deinstalled]
    $ sudo apt-get install python-requests python-pip
    

    If you have this problem with Python 3, you have to write python3 instead of python.

    0 讨论(0)
  • 2020-11-28 19:06

    You can download recent packages manually from these pages:

    • https://packages.debian.org/fr/stretch/all/python3-pip/download
    • https://packages.debian.org/fr/stretch/all/python-pip-whl/download

    Then, install it by running dpkg:

    dpkg -i *.deb
    
    0 讨论(0)
  • 2020-11-28 19:06

    For CentOS I used this and it worked please use the following commands:

    sudo pip uninstall requests
    sudo pip uninstall urllib3
    sudo yum remove python-urllib3
    sudo yum remove python-requests
    

    (confirm that all those libraries have been removed)

    sudo yum install python-urllib3
    sudo yum install python-requests
    
    0 讨论(0)
  • 2020-11-28 19:09

    While this previous answer might be the reason, this snipped worked for me as a solution (in Ubuntu 14.04):

    First remove the package from the package manager:

    # apt-get remove python-pip
    

    And then install the latest version by side:

    # easy_install pip
    

    (thanks to @Aufziehvogel, @JunchaoGu)

    0 讨论(0)
提交回复
热议问题