Skip to content
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

scikit-learn not installed correctly #4691

Closed
fatledger opened this issue May 7, 2015 · 19 comments
Closed

scikit-learn not installed correctly #4691

fatledger opened this issue May 7, 2015 · 19 comments

Comments

@fatledger
Copy link

I followed instructions to install scikit-learn on my redhat linux server,
http://scikit-learn.org/stable/install.html

Installation completed successfully. However the ensuing test failed, Is this a known problem?

$ nosetests sklearn --exe
......
Call-back cb_calcfc_in__cobyla__user__routines failed.
Ecapi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
Ecapi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
E.capi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
Ecapi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
EEcapi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
EEEE....EEEEE.EE.EEE...E....E..EEEEEEEEE..EEE.....EEEEE.E.EE..EEEEEEEEEEE.E.E...EE....E.EEEE..EE.EEEE...........EEEEEEEEEEEEEEEEEEEE..........EEEEEEEEEE..EEEEETracebackmost recent call last):
File "/usr/bin/nosetests", line 8, in
load_entry_point('nose==0.10.4', 'console_scripts', 'nosetests')()
File "/usr/lib/python2.6/site-packages/nose/core.py", line 219, in init
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "/usr/lib64/python2.6/unittest.py", line 816, in init
self.runTests()
File "/usr/lib/python2.6/site-packages/nose/core.py", line 298, in runTests
result = self.testRunner.run(self.test)
File "/usr/lib/python2.6/site-packages/nose/core.py", line 62, in run
test(result)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 168, in run
test(orig)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 168, in run
test(orig)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 168, in run
test(orig)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 168, in run
test(orig)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 168, in run
test(orig)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 138, in call
return self.run(_arg, *_kw)
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 161, in run
for test in self._tests:
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 283, in _get_wrapped_tests
for test in self._get_tests():
File "/usr/lib/python2.6/site-packages/nose/suite.py", line 79, in _get_tests
for test in self.test_generator:
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 221, in generate
for test in g():
......
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/tests/test_common.py", line 918, in test_averaging_multilabel_all_zeroes
y_pred_binarize, is_multilabel=True)
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/utils/testing.py", line 300, in wrapper
return fn(_args, *_kwargs)
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/tests/test_common.py", line 817, in _check_averaging
label_measure = metric(y_true, y_pred, average=None)
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/tests/test_common.py", line 916, in
precision_score, y_true, y_score, average))
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/base.py", line 122, in _average_binary_score
sample_weight=score_weight)
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/classification.py", line 1082, in precision_score
sample_weight=sample_weight)
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/metrics/classification.py", line 912, in precision_recall_fscore_support
minlength=len(labels))
File "/home/oracle/.local/lib/python2.6/site-packages/sklearn/utils/fixes.py", line 345, in bincount
return np.bincount(x, weights, minlength)
TypeError: function takes at most 2 arguments (3 given)
......

@amueller
Copy link
Member

amueller commented May 8, 2015

That doesn't look good. Can you check your numpy installation? How did you install numpy?

@fatledger
Copy link
Author

What's the easiest way to validate my numpy installation? It was installed using pip - "pip install numpy".

@amueller
Copy link
Member

that is not what the installation instructions say ;) Did you run sudo yum -y install gcc gcc-c++ numpy python-devel scipy before?

Maybe do np.test()? or nosetests -sv numpy on the console?

@fatledger
Copy link
Author

Looks like my update was lost...

We ran "yum -y install gcc gcc-c++ numpy python-devel scipy" as root, then ran "pip install numpy".

Basically we followed instructions and all commands completed without errors.

np.test() failed with "not defined" error.

nosetests -sv numpy returned a number of errors,

ERROR: test_umath.TestComplexFunctions.test_branch_cuts_failing

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/case.py", line 182, in runTest
self.test(*self.arg)
File "/usr/lib64/python2.6/site-packages/numpy/testing/decorators.py", line 213, in knownfailer
raise KnownFailureTest, msg
KnownFailureTest: These branch cuts are known to fail

ERROR: test_umath_complex.TestCarg.test_zero

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/case.py", line 182, in runTest
self.test(*self.arg)
File "/usr/lib64/python2.6/site-packages/numpy/testing/decorators.py", line 213, in knownfailer
raise KnownFailureTest, msg
KnownFailureTest: Complex arithmetic with signed zero is buggy on most implementation

ERROR: test_umath_complex.TestCexp.test_special_values2

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/case.py", line 182, in runTest
self.test(*self.arg)
File "/usr/lib64/python2.6/site-packages/numpy/testing/decorators.py", line 213, in knownfailer
raise KnownFailureTest, msg
KnownFailureTest: cexp(nan + 0I) is wrong on most implementations

ERROR: test_special_values (test_umath_complex.TestClog)

Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/numpy/testing/decorators.py", line 213, in knownfailer
raise KnownFailureTest, msg
KnownFailureTest: clog(- inf + i inf) fails on Windows.

ERROR: Failure: ImportError (cannot import name fib2)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/f2py_ext/tests/test_fib2.py", line 3, in
from f2py_ext import fib2
ImportError: cannot import name fib2

ERROR: Failure: ImportError (cannot import name foo)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py", line 3, in
from f2py_f90_ext import foo
ImportError: cannot import name foo

ERROR: Failure: ImportError (cannot import name fib3)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/gen_ext/tests/test_fib3.py", line 3, in
from gen_ext import fib3
ImportError: cannot import name fib3

ERROR: Failure: ImportError (No module named primes)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/pyrex_ext/tests/test_primes.py", line 3, in
from pyrex_ext.primes import primes
ImportError: No module named primes

ERROR: Failure: ImportError (cannot import name example)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/swig_ext/tests/test_example.py", line 3, in
from swig_ext import example
ImportError: cannot import name example

ERROR: Failure: ImportError (cannot import name example2)

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib64/python2.6/site-packages/numpy/distutils/tests/swig_ext/tests/test_example2.py", line 3, in
from swig_ext import example2
ImportError: cannot import name example2


Ran 2489 tests in 5.311s

FAILED (errors=10)

@fatledger
Copy link
Author

I heard a lot good things about scikit-learn and also was told installation was bad. But I could not have expected it to be so difficult.

@amueller
Copy link
Member

This is not really an issue with scikit-learn, your numpy installation is faulty. If you want the easy way out, install anaconda from continuum.io: http://continuum.io/downloads

@amueller
Copy link
Member

btw if you just didn't upgrade your numpy using pip, it would probably also worked fine. Where in the instruction does it say to do pip install numpy?

@fatledger
Copy link
Author

Sorry. That was a typo. I ran pip to install scikit, not numpy,
pip install -U scikit-learn

@fatledger
Copy link
Author

I've been working with our linux admin but installation has been surprisingly difficult so far, partly because the prerequisites on our system maybe too old and it's not easy to upgrade.

Is there a windows version that can be installed with just a few clicks, like R or octave. I'd like to try that before giving up on scikit.

@GaelVaroquaux
Copy link
Member

As mentionned everywhere, including by @amueller, you should install
Anaconda Python, which comes with scikit-learn.

@fatledger
Copy link
Author

Not sure that won't cause any conflict in our environment but I can try that when we create new environments. Thanks.

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented May 21, 2015 via email

@fatledger
Copy link
Author

Unfortunately we have existing scripts that depend on what's already installed.

Btw, is the 32-bit version of Anaconda more stable than 64-bit? I've heard some issues with the 64-bit version.

@amueller
Copy link
Member

I have never heard of issues with the 64 bit version.

How do you have a choice of "giving up on scikit" if you depend on existing scripts? That seems slightly contradictory.

@amueller
Copy link
Member

just to be clear: you can install anaconda in your home folder and use it for all your scientific python needs without having ever to talk to an admin or any other python user on this machine.

@fatledger
Copy link
Author

That did sound somewhat contradictory. "existing scripts" are non-scipy/numpy/scikit. Thanks for the help.

@amueller
Copy link
Member

well if they are non-scipy/numpy/scikit then there shouldn't be a problem with upgrading to anaconda, right?

@fatledger
Copy link
Author

I don't know enough about Anaconda. If it's 100% compatible with what we have, yes it should be ok to upgrade. Will definitely look into that.

@amueller
Copy link
Member

closing as old / numpy install problems

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