4

I'm currently in the process of installing the scikit-learn package for Python on a computer with no root access. Using Python 2.7 on Fedora 14.

pip is not installed, so I'm using easy_install:

easy_install --prefix=$HOME/.local -U scikit-learn

The installation process complains about BLAS not being installed. I've tried installing scipy in the past and had trouble both finding and installing Atlas/BLAS. Since then I've checked that numpy has no problem with Atlas:

>>> import numpy as np
>>> np.__config__.show()
atlas_threads_info:
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/usr/lib/atlas']
    language = f77
    include_dirs = ['/usr/include']

blas_opt_info:
    libraries = ['ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/usr/lib/atlas']
    define_macros = [('ATLAS_INFO', '"\\"3.8.3\\""')]
    language = c
    include_dirs = ['/usr/include']

atlas_blas_threads_info:
    libraries = ['ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/usr/lib/atlas']
    language = c
    include_dirs = ['/usr/include']

lapack_opt_info:
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/usr/lib/atlas']
    define_macros = [('ATLAS_INFO', '"\\"3.8.3\\""')]
    language = f77
    include_dirs = ['/usr/include']

lapack_mkl_info:
  NOT AVAILABLE

blas_mkl_info:
  NOT AVAILABLE

mkl_info:
  NOT AVAILABLE

/usr/lib/atlas exists, and contains .so files.

This was the error that easy_install exists on:

error: Setup script exited with error: Command "gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/lib/python2.7/site-packages/numpy/core/include -I/usr/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c sklearn/__check_build/_check_build.c -o build/temp.linux-i686-2.7/sklearn/__check_build/_check_build.o" failed with exit status 1
/usr/lib/python2.7/site-packages/numpy/distutils/misc_util.py:248: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import
  from numpy.distutils import log

And the warnings from earlier in the install:

/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:1392: UserWarning:
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.

So the install process seems unable to find either numpy or Atlas. How do I tell it where to find these?

Druckles
  • 3,161
  • 2
  • 41
  • 65

3 Answers3

0

I would prefer asking this in a comment but do not have sufficient reputation to do so:

Does export ATLAS=/usr/lib/atlas/libatlas.so before easy_install help?

0

If you don't have root access and you want install your own modules virtualenv is the way to go.

To set one default environment just do:

$ pip install virtualenv
$ virtualenv ~/.default_env

# Add the activate script to the bashrc

$ echo "source ~/.default_env/bin/activate

After this you can use pip or easy_install to install whatever package you want.

Javier Castellanos
  • 9,346
  • 2
  • 15
  • 19
0

Installing numpy and scipy from source can sometimes be tricky. If you want an easy way out, I recommend intalling a scientific python distribution, which will install a separate python with all necessary libraries. There are several options out there, I recommend anaconda from continuum.io, which you can download here.

Andreas Mueller
  • 27,470
  • 8
  • 62
  • 74