scikit-learn dependency error for cython in CentOS7 and CentOS8

gnusys

Active member
The plugin try to install scikit-learn via RPM script on centos7 and Centos8 and fails with the following error

Related to https://github.com/SciTools/cf-units/issues/106

As a fix the RPM script should also include pip3 install cython



Collecting threadpoolctl>=2.0.0 (from scikit-learn->sklearn)
Downloading https://files.pythonhosted.org/pack...0f33f133/threadpoolctl-2.1.0-py3-none-any.whl
Installing collected packages: pytz, numpy, pandas, scipy, joblib, threadpoolctl, scikit-learn, sklearn, schedule, pycrypto, simple-crypt, pika, fuzzywuzzy, levmatch, python-Levenshtein, unidecode, fsspec, func-timeout
Running setup.py install for scikit-learn: started
Running setup.py install for scikit-learn: finished with status 'error'
Complete output from command /bin/python3.6 -u -c "import setuptools, tokenize;__file__='/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /root/tmp/pip-fwyhipy7-record/install-record.txt --single-version-externally-managed --compile:
Partial import of sklearn during the build process.
Traceback (most recent call last):
File "/root/tmp/pip-build-55myl9h5/scikit-learn/sklearn/_build_utils/__init__.py", line 27, in _check_cython_version
import Cython
ModuleNotFoundError: No module named 'Cython'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 306, in <module>
setup_package()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 302, in setup_package
setup(**metadata)
File "/usr/local/lib64/python3.6/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 186, in configuration
_check_cython_version()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/sklearn/_build_utils/__init__.py", line 30, in _check_cython_version
raise ModuleNotFoundError(message) from e
ModuleNotFoundError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source.

----------------------------------------
Command "/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /root/tmp/pip-fwyhipy7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /root/tmp/pip-build-55myl9h5/scikit-learn/
 
The plugin try to install scikit-learn via RPM script on centos7 and Centos8 and fails with the following error

Related to https://github.com/SciTools/cf-units/issues/106

As a fix the RPM script should also include pip3 install cython



Collecting threadpoolctl>=2.0.0 (from scikit-learn->sklearn)
Downloading https://files.pythonhosted.org/pack...0f33f133/threadpoolctl-2.1.0-py3-none-any.whl
Installing collected packages: pytz, numpy, pandas, scipy, joblib, threadpoolctl, scikit-learn, sklearn, schedule, pycrypto, simple-crypt, pika, fuzzywuzzy, levmatch, python-Levenshtein, unidecode, fsspec, func-timeout
Running setup.py install for scikit-learn: started
Running setup.py install for scikit-learn: finished with status 'error'
Complete output from command /bin/python3.6 -u -c "import setuptools, tokenize;__file__='/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /root/tmp/pip-fwyhipy7-record/install-record.txt --single-version-externally-managed --compile:
Partial import of sklearn during the build process.
Traceback (most recent call last):
File "/root/tmp/pip-build-55myl9h5/scikit-learn/sklearn/_build_utils/__init__.py", line 27, in _check_cython_version
import Cython
ModuleNotFoundError: No module named 'Cython'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 306, in <module>
setup_package()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 302, in setup_package
setup(**metadata)
File "/usr/local/lib64/python3.6/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py", line 186, in configuration
_check_cython_version()
File "/root/tmp/pip-build-55myl9h5/scikit-learn/sklearn/_build_utils/__init__.py", line 30, in _check_cython_version
raise ModuleNotFoundError(message) from e
ModuleNotFoundError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source.

----------------------------------------
Command "/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/root/tmp/pip-build-55myl9h5/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /root/tmp/pip-fwyhipy7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /root/tmp/pip-build-55myl9h5/scikit-learn/

Hello,

thank you for the information, we will make corrections in the next release.
 
Back
Top