0
votes

I am currently encountering below issues when trying to install any version of Scikit Learn (0.19.0 or 0.19.1 or 0.19.2) for Python 3.7 or 2.7 on Linux - RHEL / Centos 7 OS.

Few months back I could successfully install scikit-learn under python 2.7 without issues. When I re-run the installation of scikit-learn package under python 2.7 its failing with the same below error.

I have installed all the required OS and Python package dependencies prior to installing the scikit-learn

I have installed all the prerequisite - OS packages - blas-devel , lapack-devel , atlas-devel.

Python Version - 3.7

/usr/local/bsb-python37 - Custom Location in which I configured and installed Python 3.7

Steps I followed to install Python and Python Packages.

Installed Python with below steps - Followed the same procedure for Python 2.7 and 3.7

Install Python 2.7
bash "build-and-install-python2.7" do
cwd '/tmp/python'
code <<-EOH
tar -xvf Python-2.7.14.tgz --no-same-owner / tar -xvf Python-3.7.0.tgz --no-same-owner
sleep 10
cd Python-2.7.14 / cd Python-3.7.0
./configure --prefix=/usr/local/bsb-python27 (and bsb-python37)
make && make altinstall
EOH
not_if { ::File.exist?('/usr/local/bsb-python27/bin/python2.7') }
end

Package Installation Steps

Install scikitlearn
bash "scikitlearn-install" do
cwd '/tmp/python'
code <<-EOH
tar xzvf scikit-learn-0.19.0.tar.gz or scikit-learn-0.19.1.tar.gz or scikit-learn-0.19.2.tar.gz
sleep 10
cd scikit-learn-0.19.1 or cd scikit-learn-0.19.1 or scikit-learn-0.19.2
/usr/local/bsb-python27/bin/python2.7 setup.py install --prefix=/usr/local/bsb-python27
EOH
not_if " /usr/local/bsb-python27/bin/python2.7 -c 'import sklearn;' "
end

Few months back when I installed scikit-learn under Python 2.7 I didn't run into any issues. Now when I re-try to install the scikit learn under Python 2.7 I am running into the same issue and the earlier successful installed version of scikit learn is corrupted.

Error Message :

/usr/local/bsb-python37/bin/python3.7 setup.py install --prefix=/usr/local/bsb-python37 Partial import of sklearn during the build process. blas_opt_info: blas_mkl_info: customize UnixCCompiler libraries mkl_rt not found in ['/usr/local/bsb-python37/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE

blis_info: customize UnixCCompiler libraries blis not found in ['/usr/local/bsb-python37/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE

error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/bsb-python37/lib/python3.7/site-packages/numpy-1.14.5-py3.7-linux-x86_64.egg/numpy/core/include -I/usr/local/bsb-python37/lib/python3.7/site-packages/numpy-1.14.5-py3.7-linux-x86_64.egg/numpy/core/include -I/usr/local/bsb-python37/include/python3.7m -c sklearn/cluster/_dbscan_inner.cpp -o build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o -MMD -MF build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o.d" failed with exit status 1

Any help is greatly appreciated. I tried to google around and did all that I could try. No luck.

1
Is there any reason why you're not using pypi (pip) or anaconda? This question is not about programming, so it would be better suited over at Super Useruser2653663
scikit-learn has not been updated to be used with python 3.7. So even if you solve the above errors, it would through some warnings and maybe errors during using.Vivek Kumar
@vivek kumar - thank you for your quick response on the issue i posted. Do you have any idea which version of scikit-learn will be supported on Python 3.7 ? Few months back when i installed python 2.7 and installed scikit-learn it worked fine with out any errors. I tried to install the scikit-learn again under python 2.7 and i run into the same errors that i encounter when i try to install scikit-learn under python 3.7Abhishek
Currently scikit-learn works well with python2.7 and python3.6. Only the version which is in development (master branch) of github may have been updated to work with python 3.7. Stable versions are not compatible (without warnings or errors)Vivek Kumar
@vivek.kumar - Even for Python 2.7 the scikit-learn is not working now. Earlier when i installed the scikit-learn for Python 2.7 it did work but now its failing. The error messages i get is the same as above i pasted. Any help or direction is totally appreciated.Abhishek

1 Answers

0
votes

I have just used pip install sklearn as an alternative. It worked for me.