Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I've just installed pip by doing

sudo apt-get install python-pip

But I am facing a problem... When I want to download a module (pygame for exemple) it fails by throwing these errors :

Traceback (most recent call last):
  File "/usr/local/bin/pip2", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip2')()
  File "/usr/lib/python2.7/dist-packages/", line 343, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/", line 2309, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/", line 2015, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/", line 11, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/vcs/", line 9, in <module>
    from import path_to_url
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.4-py2.7.egg/pip/", line 2, in <module>
    import email.utils
  File "/usr/lib/python2.7/email/", line 32, in <module>
    from email._parseaddr import quote
  File "/usr/lib/python2.7/email/", line 16, in <module>
    import time, calendar
  File "/usr/lib/python2.7/", line 10, in <module>
    import locale as _locale
  File "/usr/lib/python2.7/", line 15, in <module>
    import encodings
ImportError: No module named encodings

I don't unerstand what can I do.

Thank you!

share|improve this question
Please give details or link to instructions for how you installed Python, including version, download site, environmental setup, etc... – Flak DiNenno Mar 29 '14 at 9:46
@Floufen you can install pygame using 'code'sudo apt-get install python-pygame'code' and you should do 'code'sudo pip install python-pygame'code' – jaysheel utekar Jul 26 '15 at 7:28

Which version of python did you install? Your paths might be messed up and it may have installed PIP for the wrong version of python you're using if you have multiple versions installed.

Similar Problem

share|improve this answer
Hi grant, thank you for your answer. I set up my python like presented in the link below but nothing has changed. My pip version is the 1.4.1-2 and I am running on Linux mint 16. I don't know what goes wrong but when I try to execute, any unknown command in the terminal it thows me ImportError: No module named site it's very odd... – Floufen Mar 3 '14 at 9:54
@Floufen what "link below" are you speaking of when you said "Hi grant, thank you for your answer. I set up my python like presented in the link below but nothing has changed" in the above comment? You are almost definitely the victim of a path problem – Flak DiNenno Mar 26 '14 at 17:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.