Venom4992
Venom4992

Reputation: 34

PYTHON: I can't get scipy/sklearn to work. No scipy module

Windows 10 Python 2.7 Anaconda pip

I am having big problems installing SciKit.

I have tried every installation option I can find.

tried installing with pip and anaconda. It says it is successfully installed but I can't import it to my script - I get error -

Traceback (most recent call last): File "C:/Python27/trash.py", line 1, in from sklearn import datasets File "C:\Python27\lib\site-packages\sklearn__init__.py", line 134, in from .base import clone File "C:\Python27\lib\site-packages\sklearn\base.py", line 10, in from scipy import sparse ImportError: No module named scipy

I have installed numpy, pandas, ipython, sympy, scipy etc .... everything that any post or forum says is needed. My pc says I already have scipy installed. I was told the easiest option was to do it with Anaconda. Anaconda also says it is all already installed.

/////////////////////////////////////////////////////////////////////// If I try install it with pip install scipy or pip -U install scipy I get this error --- Command "c:\python27\python.exe -u -c "import setuptools, tokenize;file='c:\users\james\appdata\local\temp\pip-build-g1vohj\scipy\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:\users\james\appdata\local\temp\pip-xjacl_-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\james\appdata\local\temp\pip-build-g1vohj\scipy\

/////////////////////////////////////////// Anaconda using conda install scipy I get --

(C:\Users\james\Anaconda2) C:\Users\james>conda install scipy Fetching package metadata ........... Solving package specifications: . # All requested packages already installed. # packages in environment at C:\Users\james\Anaconda2: # scipy 0.19.1 np113py27_0

I get the same response when installing all the stuff that is required like numpy. //////////////////////////////////////////////////////////

I am trying to get started on machine learning but this is just a nightmare.

please help me...

Upvotes: 2

Views: 557

Answers (1)

Andeep Toor
Andeep Toor

Reputation: 11

It looks to me like you may have two versions of Python installed. In your original stack trace, you can see that the version of Python that is complaining about scipy is coming from "C:/Python27/". However, your install of Anaconda looks like it's coming from "C:/Users/james/Anaconda2".

I would recommend putting Anaconda's python.exe first in your PATH.

Upvotes: 0

Related Questions