Take the 2-minute tour ×

Is there any way to force python module to be installed in the following directory? /usr/lib/python2.7

share|improve this question
add comment

2 Answers

This is kind of a non-answer, but are you able to use virtualenv?


It makes dealing with multiple versions of Python and library management amazingly easy. And it's simple to use once you get used to it.

You can create a Python 2.7 virtualenv and pip/easy_install will automatically install modules to it.

share|improve this answer
thanks, but, let me change the question: how to make sure that a module (e.g. bitbucket.org/spirit/guess_language) that is supposed to be installed already, is properly installed? This is a very general question, I know, but the thing is, that I am really struggling make it work... –  eualin Nov 25 '12 at 19:35
The easiest way I know is to run the python shell (usually just "python" at a command prompt) and try importing the module with "import guess_language". If you get an ImportError, it's not installed. –  Rachel Sanders Nov 26 '12 at 4:27
add comment

Install the module:

sudo pip-2.7 install guess_language

Validate import and functionality:

> Python2.7
>>> import guess_language
>>> print guess_language.guessLanguage(u"שלום לכם")


share|improve this answer
@first question: I don't have pip-2.7. I have only pip. Is that a problem? –  eualin Nov 25 '12 at 20:44
When you install pip, it installs specific "pips" per a python interpreter. You might have both 2.7 and 2.6 installed on your machine. When you invoke "python" on the command line, which interpreter starts? 2.7? 2.6? –  Tal Weiss Nov 26 '12 at 14:35
add comment

Your Answer


