question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.21.0 sdist appears to be invalid

See original GitHub issue

Description

Trying to install scikit-learn 0.21 from source in a clean venv fails.

Steps/Code to Reproduce

python -mvenv /tmp/tmpenv && source /tmp/tmpenv/bin/activate
pip install numpy
pip install --no-cache --no-binary=scikit-learn scikit-learn

Expected Results

scikit-learn is installed

Actual Results

Collecting scikit-learn
  Downloading https://files.pythonhosted.org/packages/9b/94/a24da18837e32ae2d5275b18308a542ae07891617501336b31c81a383cad/scikit-learn-0.21.0.tar.gz (12.2MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 12.2MB 44.5MB/s 
Requirement already satisfied: numpy>=1.11.0 in ./tmpenv/lib/python3.7/site-packages (from scikit-learn) (1.16.3)
Requirement already satisfied: scipy>=0.17.0 in ./tmpenv/lib/python3.7/site-packages (from scikit-learn) (1.2.1)
Requirement already satisfied: joblib>=0.11 in ./tmpenv/lib/python3.7/site-packages (from scikit-learn) (0.13.2)
Installing collected packages: scikit-learn
  Running setup.py install for scikit-learn ... error
    Complete output from command /tmp/tmpenv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7semrfib/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-record-96g5nwiz/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/tmpenv/include/site/python3.7/scikit-learn:
    Partial import of sklearn during the build process.
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/tmp/tmpenv/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE
    
    blis_info:
    customize UnixCCompiler
      libraries blis not found in ['/tmp/tmpenv/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE
    
    openblas_info:
    customize UnixCCompiler
    customize UnixCCompiler
    customize UnixCCompiler
      FOUND:
        libraries = ['openblas', 'openblas']
        library_dirs = ['/usr/lib64']
        language = c
        define_macros = [('HAVE_CBLAS', None)]
    
      FOUND:
        libraries = ['openblas', 'openblas']
        library_dirs = ['/usr/lib64']
        language = c
        define_macros = [('HAVE_CBLAS', None)]
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-7semrfib/scikit-learn/setup.py", line 280, in <module>
        setup_package()
      File "/tmp/pip-install-7semrfib/scikit-learn/setup.py", line 276, in setup_package
        setup(**metadata)
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/core.py", line 137, in setup
        config = configuration()
      File "/tmp/pip-install-7semrfib/scikit-learn/setup.py", line 171, in configuration
        config.add_subpackage('sklearn')
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 1036, in add_subpackage
        caller_level = 2)
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 1005, in get_subpackage
        caller_level = caller_level + 1)
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 942, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "sklearn/setup.py", line 53, in configuration
        config.add_subpackage('ensemble/_hist_gradient_boosting/tests')
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 1036, in add_subpackage
        caller_level = 2)
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 998, in get_subpackage
        caller_level = caller_level+1)
      File "/tmp/tmpenv/lib/python3.7/site-packages/numpy/distutils/misc_util.py", line 780, in __init__
        raise ValueError("%r is not a directory" % (package_path,))
    ValueError: 'sklearn/ensemble/_hist_gradient_boosting/tests' is not a directory
    
    ----------------------------------------
Command "/tmp/tmpenv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7semrfib/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-record-96g5nwiz/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/tmpenv/include/site/python3.7/scikit-learn" failed with error code 1 in /tmp/pip-install-7semrfib/scikit-learn/
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Versions

In [1]: import platform; print(platform.platform())                                             
Linux-5.0.12-arch2-1-ARCH-x86_64-with-arch

In [2]: import sys; print("Python", sys.version)                                                
Python 3.7.3 (default, Mar 26 2019, 21:43:19) 
[GCC 8.2.1 20181127]

In [3]: import numpy; print("NumPy", numpy.__version__)                                         
NumPy 1.16.3

In [4]: import scipy; print("SciPy", scipy.__version__)                                         
SciPy 1.2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ogriselcommented, May 10, 2019

I believe we just need to add an __init__.py file to make it a package to be included in the sdist.

0reactions
agramfortcommented, May 13, 2019

maybe we could add https://pypi.org/project/check-manifest/ to the one of the CI test

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to upgrade the classifier to the latest version of scikit-learn
You should be able to circumvent this problem by first updating sklearn to the latest version, then loading the pickled objects with joblib.load...
Read more >
Bitcoin Core 0.21.0
The bitcoin-cli -getinfo command now displays the wallet name and balance for each of the loaded wallets when more than one is loaded...
Read more >
how to resolve sklearn version mismatch - Alteryx Community
2 when using version 0.21.1. This might lead to breaking code or invalid results. Use at your own risk. and then this error:....
Read more >
wheel Documentation - Read the Docs
The wheel will go to dist/yourproject-<tags>.whl. ... If the egg file name is invalid: ... 0.21.0 (2013-07-20).
Read more >
How to Setup Your Python Environment for Machine Learning ...
You don't appear to have the necessary permissions to install packages ... installing scikit learn. getting a syntax error: invalid syntax.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found