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.

Installing scikit-learn from the main branch fails with `scikit-learn requires numpy >= 1.14.6`

See original GitHub issue

Describe the bug

pip install git+https://github.com/scikit-learn/scikit-learn.git

fails with the following error:

$ pip install git+https://github.com/scikit-learn/scikit-learn.git
Collecting git+https://github.com/scikit-learn/scikit-learn.git
  Cloning https://github.com/scikit-learn/scikit-learn.git to /tmp/pip-req-build-xbo_4nwf
  Running command git clone -q https://github.com/scikit-learn/scikit-learn.git /tmp/pip-req-build-xbo_4nwf
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/share/miniconda/bin/python /usr/share/miniconda/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpmzvhqjhs
         cwd: /tmp/pip-req-build-xbo_4nwf
    Complete output (24 lines):
    Partial import of sklearn during the build process.
    Traceback (most recent call last):
      File "/usr/share/miniconda/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
        main()
      File "/usr/share/miniconda/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/share/miniconda/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-jjptwtgc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-jjptwtgc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 259, in run_setup
        self).run_setup(setup_script=setup_script)
      File "/tmp/pip-build-env-jjptwtgc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 300, in <module>
        setup_package()
      File "setup.py", line 286, in setup_package
        check_package_status('numpy', min_deps.NUMPY_MIN_VERSION)
      File "setup.py", line 223, in check_package_status
        req_str, instructions))
    ImportError: Your installation of numpy 1.14.5 is out-of-date.
    scikit-learn requires numpy >= 1.14.6.
    Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html

Steps/Code to Reproduce

pip install git+https://github.com/scikit-learn/scikit-learn.git

Expected Results

pip install git+https://github.com/scikit-learn/scikit-learn.git

should successfully install the dev version of scikit-learn

Actual Results

Versions

I’m using Python 3.7.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ogriselcommented, Jun 3, 2021

I merged #20184, let’s see if it works as expected.

1reaction
thomasjpfancommented, Jun 2, 2021

Merging https://github.com/scikit-learn/scikit-learn/pull/20184 should resolve this issue. (Although it means we are deviating a little from oldest-supported-numpy)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: Numerical Python (NumPy) is not installed. #5904
Appartently the setup.py of scikit-learn fails to import numpy. ... Python (NumPy) is not installed. scikit-learn requires NumPy >= 1.6.1.
Read more >
Installing the development version of scikit-learn
This section introduces how to install the main branch of scikit-learn. This can be done by either installing a nightly build or building...
Read more >
Can't install scikit-learn using pip - Stack Overflow
Try executing this: py -m pip uninstall numpy scipy sklearn. Then execute this: py -m pip install numpy scipy sklearn.
Read more >
Installing scikit-learn - GitHub Pages
There are different ways to get scikit-learn installed: Install the version of scikit-learn provided by your operating system or Python distribution.
Read more >
sklearn upgrade - Kaggle
!pip install --upgrade scikit-learn. Requirement already satisfied: scikit-learn in /opt/conda/lib/python3.7/site-packages (0.23.2) Collecting scikit-learn ...
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