You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is properly filed with scikit-learn or pip, but this is what I found. I assumed that pip would install all necessary dependencies upon running
pip install scikit-learn
However, pip did not install scipy. This lead to a traceback with a very vague error message from the file sklearn/init.py,
ImportError: cannotimportname__check_build
It seems reasonable that scikit-learn would instead alert the user to the fact that there is a missing dependency, and is not actually installed incorrectly.
On 02/17/2013 04:51 PM, Hrishikesh Huilgolkar wrote:
I installed pip install scikit-learn without scipy. It did not give me
any error.
When i imported sklearn in ipython, it game me error, could not find
scipy.
So this issue is resolved?
—
Reply to this email directly or view it on GitHub #1495 (comment).
I guess it is running the tests that results in the error.
Wouldn't the "right" way be to add scipy to the requirements.txt. I guess we don't do that because we don't want to make people pip install numpy? Also see #4164
Wouldn't the "right" way be to add scipy to the requirements.txt.
It would probably lead to some horrible message crashing because of the
lack of a fortran compiler. I'd much rather have people that do not have
scipy installed go and read the install instructions (ours, or scipy's)
to see that it is strongly advised not to install scipy from source.
Relying on the automatic dependency crawling actually only works for
advanced users who has a sane build environment, and paradoxically not
for Joe users who think that they might benefit from it.
Possibly even without the error traceback would be better, i.e. print to
stderr and exit -1.
No: errors are mean exactly for this: to be captured elsewhere. An
expection is a machine understandable error message, unlike something
printed to stderr.
Mhmmm. I guess it is actually an ImportError and I wasn't thinking of the
case where the first use is through some other software, which is, of
course, common. I stand corrected.
On 27 January 2015 at 10:59, Gael Varoquaux [email protected]
wrote:
Possibly even without the error traceback would be better, i.e. print to
stderr and exit -1.
No: errors are mean exactly for this: to be captured elsewhere. An
expection is a machine understandable error message, unlike something
printed to stderr.
—
Reply to this email directly or view it on GitHub #1495 (comment)
.
Activity
amueller commentedon Jan 5, 2013
Thanks for the report. Does any-one know how/whether pip checks dependencies? And where the error comes from?
hrishikeshio commentedon Feb 17, 2013
I think we need a requirements setting in setup.py
Check out nltk's setup vs ours.
https://github.com/nltk/nltk/blob/master/setup.py#L84
https://github.com/scikit-learn/scikit-learn/blob/master/setup.py#L111
amueller commentedon Feb 17, 2013
On 02/17/2013 04:51 PM, Hrishikesh Huilgolkar wrote:
larsmans commentedon Feb 26, 2013
Adding an
install_requiresdoesn't work, probably because we usenumpy.distutils.core.setupinstead of setuptools.erg commentedon Feb 26, 2013
Numpy itself requires an older version of itself or else errors during installation.
numpy/numpy#2990
asifhj commentedon Jan 23, 2015
Resolved by installing
pip install scipy
I avoided using specific version, earlier I was using latest version of scipy that might be the reason I was getting error.
ogrisel commentedon Jan 23, 2015
+1 for at least improving the error message triggered by
sklearn/__init__.py.amueller commentedon Jan 26, 2015
Wouldn't the "right" way be to add scipy to the
requirements.txt. I guess we don't do that because we don't want to make people pip install numpy? Also see #4164amueller commentedon Jan 26, 2015
@larsmans we could use build-requires as scipy does, right:
https://github.com/scipy/scipy/blob/master/setup.py#L190
GaelVaroquaux commentedon Jan 26, 2015
It would probably lead to some horrible message crashing because of the
lack of a fortran compiler. I'd much rather have people that do not have
scipy installed go and read the install instructions (ours, or scipy's)
to see that it is strongly advised not to install scipy from source.
Relying on the automatic dependency crawling actually only works for
advanced users who has a sane build environment, and paradoxically not
for Joe users who think that they might benefit from it.
amueller commentedon Jan 26, 2015
How about in setup.py we do a
GaelVaroquaux commentedon Jan 26, 2015
That sounds good (with a good error message, probably pointing to online
docs with a summary of the discussion that we just had).
amueller commentedon Jan 26, 2015
Exactly.
jnothman commentedon Jan 26, 2015
Possibly even without the error traceback would be better, i.e. print to
stderr and exit -1.
On 27 January 2015 at 10:00, Andreas Mueller [email protected]
wrote:
GaelVaroquaux commentedon Jan 26, 2015
No: errors are mean exactly for this: to be captured elsewhere. An
expection is a machine understandable error message, unlike something
printed to stderr.
jnothman commentedon Jan 27, 2015
Mhmmm. I guess it is actually an ImportError and I wasn't thinking of the
case where the first use is through some other software, which is, of
course, common. I stand corrected.
On 27 January 2015 at 10:59, Gael Varoquaux [email protected]
wrote:
FIX: Ensure dependencies installed