简体   繁体   中英

Installing scikit: ImportError: cannot import name MAXREPEAT

I'm running elementary OS (a derivative of Ubuntu 12.04) on which I have installed:

Python 2.7.3 (default, Sep 26 2013, 20:08:41) 
[GCC 4.6.3] on linux2
NumPy 1.8.0, SciPy 0.12.0, Matplotlib 1.2.1

I decided to install scikit following the simple instructions given here , which is basically the line:

sudo apt-get install python-sklearn

but it fails with the error:

...
  File "/usr/local/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/local/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT

Someone apparently had a similar issue here ImportError: cannot import name MAXREPEAT with cx_Freeze but I'm not sure the questions are equivalent and the answer given tells me very little about how to fix my install. Thoughts?

Whatever the issue was, running:

sudo pip install -U scikit-learn

installed it correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM