7

I cannot install scikit-learn. I can install other packages either by building them from source or through pip without a problem. For scikit-learn, I've tried cloning the project on GitHub and installing via pip without success. Can anyone please help? Here is part of my pip.log:

Downloading/unpacking scikit-learn
  Running setup.py egg_info for package scikit-learn
    Warning: Assuming default configuration (scikits/learn/{setup_scikits.learn,setup}.py was not found)Warning: Assuming default configuration (sklearn/svm/tests/{setup_tests,setup}.py was not found)Appending scikits.learn configuration to
    Ignoring attempt to set 'name' (from '' to 'scikits.learn')
    Appending sklearn.check_build configuration to sklearn
    Ignoring attempt to set 'name' (from 'sklearn' to 'sklearn.check_build')
    Appending sklearn.svm.tests configuration to sklearn.svm
    Ignoring attempt to set 'name' (from 'sklearn.svm' to 'sklearn.svm.tests')
    blas_opt_info:
      FOUND:
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3)]
        extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
desertnaut
  • 57,590
  • 26
  • 140
  • 166
turtle
  • 7,533
  • 18
  • 68
  • 97
  • Did you check you got all the depencies : "numpy, scipy, setuptools, python development headers and a working C++ compiler." (quoting from scikit website)? – FabienAndre Apr 22 '12 at 13:23
  • I have numpy, scipy, and setuptools, but how do I check for python development headers and a working C++ compiler? – turtle Apr 22 '12 at 14:07

5 Answers5

8

Install SciPy Superpack or EPD to get all the required dependencies in one shot under OSX.

ogrisel
  • 39,309
  • 12
  • 116
  • 125
3

I came across this nice tutorial and with just a few straight forward steps you can install it via PIP like this:

(Only the outlines. For details visit the authors page.)

  1. install Xcode
  2. install pip
  3. install brew
  4. install NumPy
  5. install gfortran (important!)
  6. install SciPy
  7. install matplotlib (useful)
  8. install scikit-learn
  9. test

Also see the comments on the authors page for how to install PIP and Virtualenv.

F Lekschas
  • 12,481
  • 10
  • 60
  • 72
  • 2
    Note for mac users: http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa?rq=1 – arno_v Apr 02 '14 at 09:14
3

If you use Homebrew, then these two commands should do it for you:

brew tap homebrew/python
brew install scipy
John J. Camilleri
  • 4,171
  • 5
  • 31
  • 41
0

You can use pip to install scikit.

http://scikit-learn.org/stable/install.html

akshat thakar
  • 1,445
  • 21
  • 29
0

You can use this brew install postgresql to install packages with the correct wheel file. When a venv is activated, sometimes you need to download the correct wheel file to install certain packages. This installation uses setup.py install instead making it easy for the virtual environment to install the desired package using the pip3 installation. Another common package that requires this installation is psycopg2 for django.

brew install postgresql
pip3 install scikit-learn
desertnaut
  • 57,590
  • 26
  • 140
  • 166