When I try to install anything with pip
or pip3
, I get:
$ sudo pip3 install python3-tk
Tra
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.
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.
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
.
You can download recent packages manually from these pages:
Then, install it by running dpkg
:
dpkg -i *.deb
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
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)