12

I just did a clean install of Ubuntu 14.04 and also installed pycharm. Pycharm said setuptools and pip weren't installed and offered to install it. I simply clicked "Ÿes" and it seemed to install it. A bit after that I wanted to install Flask (which is awesome btw) using pip, so I did sudo pip install flask. To my surprise it said the following:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2797, in <module>

  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 576, in resolve
    def resolve(self, requirements, env=None, installer=None,
pkg_resources.DistributionNotFound: pip==1.4.1

So I simply tried the regular way: I downloaded get-pip.py and ran that, but that says: Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages

I found some other similar problems here on SO, which suggested to look in /usr/local/lib/python2.7/site-packages/, but that folder is empty.

Does anybody know what's wrong and how I can fix this? All tips are welcome!

Community
  • 1
  • 1
kramer65
  • 50,427
  • 120
  • 308
  • 488

2 Answers2

18

Had the same problem under 12.04.

Did sudo easy_install pip==1.4.1 and it worked.

igordc
  • 1,525
  • 1
  • 14
  • 20
2

Faced the same problem with ubuntu 14.04 ,python2.7 and pip 1.5.4

sudo apt-get install --reinstall python2.7
sudo apt-get purge python-pip
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo pip install package-name

This worked!

Sivagami Nambi
  • 332
  • 4
  • 9
  • Thanks, this also worked for me on an ubuntu 14.04. easy_install was broken the same way as pip, so the above solutions were not applicable. – Pivert Jul 01 '17 at 21:03