Error while trying to install sklearn from Pycharm | arrayobject.h cannot be absolute

北慕城南 提交于 2020-01-13 05:40:10

问题


Complete error statement:

ValueError: path '/home/andy/anaconda3/lib/python3.5/sitepackages/numpy/core/include/numpy/arrayobject.h' cannot be absolute

I have installed Scipy and numpy (mkl) version by downloading the compiled wheel files from this link and then installing it from the cmd using pip.

I'm more of a python noob, my focus is primarily machine learning. Kindly help me out.


回答1:


Listen, i encountered today a similar problem.

Do you use Python 3.6 (Latest version) ?

If you do, you might consider downgrading (reinstalling actually) to Python 3.5.. apparently, sklearn has few problems supporting Python 3.6 at the moment.




回答2:


I also installed NumPy and SciPy from link and got the same error when trying to install scikit-learn from PyPI. Installation scikit-learn from the same link solved the problem.




回答3:


This is an error due to absolute paths to include files being found in the source, which cannot be automatically converted by distutils to the correct system path when compiling on windows.

The easiest way to fix this particular issue is to add a few lines of code to "util.py" in PYTHONPATH\lib\distutils\util.py. Add to the beginning of the function "convert_path"..

if pathname.startswith('/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/'):
        paths = pathname.split('/')
        return 'C:\\Python36\\Lib\\site-packages\\numpy\\core\include\\numpy\\'+paths[-1]



回答4:


hmm..maybe it wants a relative path i.e. ../include/numpy/ and not the absolute path which contains ../arrayobject.h



来源:https://stackoverflow.com/questions/42360126/error-while-trying-to-install-sklearn-from-pycharm-arrayobject-h-cannot-be-abs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!