微软LightGBM Windows下Python安装:ImportError: cannot import name NUMPY_MKL
2017-01-12 09:42
1341 查看
最近写了一篇关于“微软开源分布式高性能GB框架LightGBM安装使用”的文章,有小伙伴安装Python环境遇到了问题。我个人也尝试安装了一下,确实遇到了很多问题。"Windows7下python的scipy库的安装"的问题解决后,又遇到“ImportError: cannot import name NUMPY_MKL”的问题。如下:
D:\LightGBM\LightGBM\examples\python-guide>python simple_example.py
Traceback (most recent call last):
File "simple_example.py", line 4, in <module>
import lightgbm as lgb
File "D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\__init__.p
y", line 9, in <module>
from .basic import Dataset, Booster
File "D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\basic.py",
line 15, in <module>
import scipy.sparse
File "D:\Python27\lib\site-packages\scipy\__init__.py", line 61, in <module>
from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl
ImportError: cannot import name NUMPY_MKL为什么会出现这样的问题呢?
参考“http://stackoverflow.com/questions/37267399/importerror-cannot-import-name-numpy-mkl”的说法是
由于我的“scipy”是按"Windows7下python的scipy库的安装"中的方法使用“.whl”文件安装的,而“numpy”是使用“pip install numpy”命令安装的。
其实我使用“pip install numpy”命令安装,实际上也是下载了一个“.whl”文件,只是和“scipy”的下载的源不一样,但是就不行了。
怎么办怎么办?
我又用命令“pip uninstall numpy”把它卸载了,
用和“scipy”同样的源,从“http://www.lfd.uci.edu/~gohlke/pythonlibs/”上下载“numpy”的安装文件。
再用命令安装:pip install numpy-1.11.3-cp27-cp27m-win_amd64.whl
问题解决了。
======================文档信息======================
版权声明:非商用自由转载-保持署名-注明出处
署名(BY) :testcs_dn(微wx笑)
文章出处:[无知人生,记录点滴](http://blog.csdn.net/testcs_dn)
D:\LightGBM\LightGBM\examples\python-guide>python simple_example.py
Traceback (most recent call last):
File "simple_example.py", line 4, in <module>
import lightgbm as lgb
File "D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\__init__.p
y", line 9, in <module>
from .basic import Dataset, Booster
File "D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\basic.py",
line 15, in <module>
import scipy.sparse
File "D:\Python27\lib\site-packages\scipy\__init__.py", line 61, in <module>
from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl
ImportError: cannot import name NUMPY_MKL为什么会出现这样的问题呢?
参考“http://stackoverflow.com/questions/37267399/importerror-cannot-import-name-numpy-mkl”的说法是
由于我的“scipy”是按"Windows7下python的scipy库的安装"中的方法使用“.whl”文件安装的,而“numpy”是使用“pip install numpy”命令安装的。
其实我使用“pip install numpy”命令安装,实际上也是下载了一个“.whl”文件,只是和“scipy”的下载的源不一样,但是就不行了。
怎么办怎么办?
我又用命令“pip uninstall numpy”把它卸载了,
用和“scipy”同样的源,从“http://www.lfd.uci.edu/~gohlke/pythonlibs/”上下载“numpy”的安装文件。
再用命令安装:pip install numpy-1.11.3-cp27-cp27m-win_amd64.whl
问题解决了。
======================文档信息======================
版权声明:非商用自由转载-保持署名-注明出处
署名(BY) :testcs_dn(微wx笑)
文章出处:[无知人生,记录点滴](http://blog.csdn.net/testcs_dn)
相关文章推荐
- Windows下Python安装: requires numpy+mkl 和ImportError: cannot import name NUMPY_MKL
- ImportError: cannot import name 'NUMPY_MKL'
- Windows10下安装numpy和scipy(避免“ImportError: cannot import name NUMPY_MKL”)
- Win10下:ImportError: cannot import name NUMPY_MKL
- Python ImportError: cannot import name NUMPY_MKL
- ImportError: cannot import name 'NUMPY_MKL' (skicit_learn)
- python安装配置Theano ImportError:cannot import name 'configparser'
- 解决bs4在Python 3.6下出现“ImportError: cannot import name 'HTMLParseError'”错误
- windows环境下python2.7、pycharm、numpy_mkl、scipy、sklearn、Matplotlib、jupyter完整安装教程
- Windows下 ImportError: cannot import name BeautifulSoup
- Windows下Python安装numpy+mkl,Scipy和statsmodels
- 安装python2.7(windows),wxpython: import wx:ImportError:DLL load failed:%1不是有效的Win32应用程序
- Python ImportError: cannot import name *
- Windows下Python安装numpy+mkl,Scipy和statsmodels
- ubuntu 16.04 ros kinetic Moveit Python: ImportError: cannot import name structs
- Windows下 ImportError: cannot import name BeautifulSoup
- windows7下python安装whl文件(numpy+mkl安装为例)
- 关于python "ImportError: cannot import name quotes_historical_yahoo" 问题
- 解决bs4在Python 3.5下出现“ImportError: cannot import name 'HTMLParseError'”错误
- 安装comtypes 0.6.2时ImportError: cannot import name DistutilsOptionError 解决办法