wdecoster / NanoPlot

Plotting scripts for long read sequencing data
http://nanoplot.bioinf.be
MIT License
413 stars 47 forks source link

install error with scikit-learn on linux #220

Closed droeatumn closed 3 years ago

droeatumn commented 3 years ago

I am having trouble installing on the latest ubuntu docker image. I'd appreciate any suggestions to fix.

apt-get update
lsb_release -a LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic apt-get install python3-pip cython3 pip3 install numpy pip3 install NanoPlot

. . . Building wheels for collected packages: scikit-learn Running setup.py bdist_wheel for scikit-learn ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-jy45lmdj/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpgy7893xfpip-wheel- --python-tag cp36: Partial import of sklearn during the build process. Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 306, in setup_package() File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 302, in setup_package setup(**metadata) File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/core.py", line 135, in setup config = configuration() File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 186, in configuration _check_cython_version() File "/tmp/pip-build-jy45lmdj/scikit-learn/sklearn/_build_utils/init.py", line 35, in _check_cython_version raise ValueError(message) ValueError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source. The current version of Cython is 0.26.1 installed in ['/usr/lib/python3/dist-packages/Cython'].


Failed building wheel for scikit-learn Running setup.py clean for scikit-learn Failed to build scikit-learn Installing collected packages: seaborn, pyarrow, retrying, plotly, scikit-learn, pauvre, NanoPlot Running setup.py install for scikit-learn ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-jy45lmdj/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 /tmp/pip-4pb2fmt7-record/install-record.txt --single-version-externally-managed --compile: Partial import of sklearn during the build process. Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 306, in setup_package() File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 302, in setup_package setup(**metadata) File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/core.py", line 135, in setup config = configuration() File "/tmp/pip-build-jy45lmdj/scikit-learn/setup.py", line 186, in configuration _check_cython_version() File "/tmp/pip-build-jy45lmdj/scikit-learn/sklearn/_build_utils/init.py", line 35, in _check_cython_version raise ValueError(message) ValueError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source. The current version of Cython is 0.26.1 installed in ['/usr/lib/python3/dist-packages/Cython'].

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-jy45lmdj/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 /tmp/pip-4pb2fmt7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-jy45lmdj/scikit-learn/

wdecoster commented 3 years ago

This seems to be the key error message:

ValueError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source. The current version of Cython is 0.26.1 installed in ['/usr/lib/python3/dist-packages/Cython'].

Please try upgrading cython.

droeatumn commented 3 years ago

Thanks. The key was to install cython with pip3 instead of apt-get.