I have installed sklearn on Ubuntu 14.04. However, when I execute a script via the command line which imports sklearn, I get an import error. Running the same script with Python IDLE yields no error and executes the script. How can I make sure that my "command line python" uses the same version as IDLE? Apparantly, that one knows where to find my downloaded modules.

1 Answer 1


I solved my problem. I added an alias to ~/.bashrc as follows:

    alias python=/usr/local/python

I found the path I was looking for by going to Python IDLE and doing the following:

    import sys

This returned the location of the python version IDLE uses. I searched around a bit and found the path I was looking for!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .