8000 PIP Package: Missed dependency? · Issue #9519 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

PIP Package: Missed dependency? #9519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gordio opened this issue Aug 10, 2017 · 3 comments
Closed

PIP Package: Missed dependency? #9519

gordio opened this issue Aug 10, 2017 · 3 comments

Comments

@gordio
Copy link
gordio commented Aug 10, 2017

Description

After installing sklearn with pip, I can't import it. After manually installing scipy (pip install scipy) import work without errors.

Steps/Code to Reproduce

mkdir test && cd test
python3 -m venv venv
. venv/bin/activate
pip install sklearn
python -c 'import sklearn''

Actual Results

>>> import sklearn
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    import sklearn
  File "/Users/gordio/Development/polo_bot/venv/lib/python3.6/site-packages/sklearn/__init__.py", line 57, in <module>
    from .base import clone
  File "/Users/gordio/Development/polo_bot/venv/lib/python3.6/site-packages/sklearn/base.py", line 10, in <module>
    from scipy import sparse
ModuleNotFoundError: No module named 'scipy'

Versions

Darwin-16.7.0-x86_64-i386-64bit
Python 3.6.2 (default, Jul 17 2017, 16:44:45)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]
NumPy 1.13.1
SciPy 0.19.1 (It's after manual installation)
Scikit-Learn 0.18.2

@rth
Copy link
Member
rth commented Aug 10, 2017

pip install sklearn

This should be pip install scikit-learn, see #8215

Also you need a working install with numpy and scipy before installing scikit-learn with pip (cf the docs). These seem to be installed in your system Python environment but not in the virtual environement. You could probably use the virtualenv with the --system-site-packages to access them from the virtualenv, but if you need scikit-learn in a virtualenv it's probably simpler to use conda that will handle the dependencies,

conda create -n test-env scikit-learn==0.18.1 python=3.6

@amueller
Copy link
Member

we do not declare scipy and numpy dependencies in setup.py for what I consider historic reasons. I'm not sure if there's an issue open for that right now.
It might be a bit tricky to allow pip install without having numpy installed, but I think we should at least be able to install without scipy installed.

@amueller
Copy link
Member

closed by #10402.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0