my code doesn't recognize `import sklearn`

I'm trying to install scikit-learn. I installed numpy and scipy, and I installed using both pip install -U scikit-learn and conda install scikit-learn (just to be sure).

However, once my code gets to a line like from sklearn import datasets - it throws an error:

 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash 
(sklearn\utils\murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling

My code doesn't seem to recognize sklearn, although I know it is installed; the only solutions I found on the web recommended on installing scipy - which I already have.

Any solutions?

Answers


Since you have conda installed, a workaround would be creating a new environment. For example:

conda create -n my_new_env python=3.5

Choose the right Python version for you.

Activate the environment.

On Windows:

activate my_new_env

On Linux/Mac OS X:

source activate my_new_env

Now:

conda install scikit-learn

and start a new Python interpreter in this environment.


Need Your Help

Python: ImportError: No module named _md5

python

I have python 2.5.1 installed on my Ubuntu 10.04 x86_64 machine.

Index changing before interval is set

javascript for-loop setinterval

I have the following function in a for-loop: