Cannot import Scikit-Learn

后端 未结 3 1383
慢半拍i
慢半拍i 2020-12-06 06:27

I tried to install scikit-learn on my Linux Mint 12 but failed. I downloaded the package from http://pypi.python.org/pypi/scikit-learn/ and installed with

su         


        
相关标签:
3条回答
  • 2020-12-06 07:06

    I ran into this today on OS X El Capitan. Unfortunately, reinstalling/installing didn't work, since the problem ended up being that numpy installation native to OS X was preferred over the one being installed by pip.

    I was able to solve this by following the guidance in: https://apple.stackexchange.com/a/223163

    In particular, I used the approach of fixing the python path to prefer pip libraries over OS X native libraries:

    Create a file called fix_mac_path.pth in /Library/Python/2.7/site-packages that has the following:

    import sys; std_paths=[p for p in sys.path if p.startswith('/System/')]; sys.path=[p for p in sys.path if not p.startswith('/System/')]+std_paths

    0 讨论(0)
  • 2020-12-06 07:13

    i was having the exact same problem. I managed to make it work by installing the windows binary for 64 bit windows from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn . Hope this works for you

    0 讨论(0)
  • 2020-12-06 07:17

    I'm not really sure, but according to this that error happens when a package that depends on numpy is compiled targeting a specific version (or a specific platform), and that package is then installed in a different environment. How did you install those two packages? (numpy and scipy)

    I'd suggest uninstalling both and then reinstalling SciPy, either using pip or from source.

    0 讨论(0)
提交回复
热议问题