1
votes

Everytime I try to install certain packages with pip3, such as sklearn or scipy I keep getting the error:

Command "/usr/local/bin/python3.5 -c "import setuptools, tokenize;file='/tmp/pip-build-379iloop/scikit-learn/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-2bvcjei9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-379iloop/scikit-learn

I tried using anaconda3 for the packages, but I can only use pip for 2.7 installations of the packages but not for 3.5. Any guesses?

1

1 Answers

1
votes

If we could see what pip printed before that, that might help narrow down what happened.

Without seeing how exactly the command failed (i.e. besides "with error code 1"), I'm going to guess you don't have BLAS and/or LAPACK installed. I'm sure this is a duplicate of some question already on here, since that's how I found out about it when I has this problem, but I can't seem to find it.

if you're on Ubuntu, you can download BLAS with

sudo apt-get install libopenblas-dev 

and LAPACK with

sudo apt-get install liblapack-dev

you might also need the packages g++, gfortran and python3-dev, also avaiable with apt-get on Ubuntu. I'm sure that packages also exist for whatever distro/OS you're using.