Closed dawenl closed 12 years ago
Do you have a _check_build library (I don't know if it's a '.so' or something else under OSX) in the corresponding library? Optionally, you can try with the latest development version of the scikit: I have made a change that will not fix your problem, but that will give a more informative error that you can copy-paste here.
I suspect that you have a build problem.
I do have a _check_build.so under /Library/Python/2.7/site-packages/scikit_learn-0.10-blabla/sklearn/check_build folder.
I will check out the newer code now and post the results so asap.
BTW, I found that I could import scikits module successfully, I am not sure what that means though.
Here is the new output from test:
Traceback (most recent call last):
File "
Contents of sklearn/check_build: init.py init.pyc _check_build.c _check_build.pyx setup.py setup.pyc
It seems that the scikit-learn has not been built correctly.
If you have installed the scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install
or
make
in the source directory.
If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.
On Tue, Nov 08, 2011 at 01:46:10PM -0800, Dawen Liang wrote:
ImportError: No module named _check_build
Contents of sklearn/check_build: init.py init.pyc _check_build.c _check_build.pyx setup.py setup.pyc
It seems that the scikit-learn has not been built correctly.
OK, it's probably because you are trying to import the scikit from the build directory. Just 'cd' elsewhere, and try again.
G
OK. Then the error becomes: (I saw this error previously while using easy_install)
Traceback (most recent call last):
File "
On Tue, Nov 08, 2011 at 01:51:53PM -0800, Dawen Liang wrote:
File "/Library/Python/2.7/site-packages/scipy-0.11.0.dev_04b8d87_20111104-py2.7-macosx-10.7-x86_64.egg/scipy/spatial/init.py", line 26, in
from ckdtree import * File "numpy.pxd", line 174, in init scipy.spatial.ckdtree (scipy/spatial/ckdtree.c:8262) ValueError: numpy.ndarray has the wrong size, try recompiling
My guess is that this is a problem with scipy, and not with the scikit: "from scipy import spatial" will probably not work.
It seems to me that scipy has been build with a different version of numpy. You need to rebuild it.
You are right that I cannot import spatial from scipy.
Actually I got some problems building scipy, so I just used trick to directly put the compiled package in my /Library/Python/2.7/site-packages. Looks like this won't work... Thanks for your help. I will turn to scipy for help now.
You should use scipy superpack under OSX: stronginference.com/scipy-superpack/
Yes, that's what I did just now. And now I could import scikits finally and run a logistic regression successfully. Though I got segmentation fault while running the tests. Maybe I will start a new thread for this.
Yes. Especially if you can narrow down which compiled extension is causing the segfault.
I have the same segfault I think. I think it's in arpack because all examples in the manifold module crash as well. I will submit a full report soon.
I get the same error if I start python from the build directory, but not otherwise.
@dhruvbird that is likely due to the fact that you have another version of sklearn installed, that gets called if you don't run from the build directory.
Hi all,
I tried to install scikit-learn on my Mac with Lion 10.7.2 (Python 2.7, numpy 1.6.1). At first I tried easy_install and got scikit-0.9 but cannot import due to some 'Don't forget to 'make' first' error and then I searched online, finding that this issue should be fixed in the newer version in github. So I checked out the code and build from source using the following two commands:
python setup.py build sudo python setup.py install
Now I've got scikit-0.10 in /Library/Python/2.7/site-packages. However, when I tried to run the tests, similar error shows up:
Traceback (most recent call last): File "", line 1, in
File "sklearn/init.py", line 30, in
""" % e)
ImportError: No module named _check_build
It seems that the scikit-learn has not been built correctly.
If you have installed the scikit-learn from source, please do not forget to build the package before using it: run
python setup.py install
ormake
in the source directory.If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.
I didn't see errors in my build and build is finished with 'running scons'. I don't know where I am doing wrong. If you need to know more, please let me know. Any help would be very appreciated. Thanks!