Windows下Python安装: requires numpy+mkl 和ImportError: cannot import name NUMPY_MKL
最近写了一篇关于“微软开源分布式高性能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”把numpy卸载了,用命令“pip uninstall mkl”把mkl卸载了
用和“scipy”同样的源,从“http://www.lfd.uci.edu/~gohlke/pythonlibs/”上下载“numpy”的安装文件(找到对应版本)
再用命令安装:pip install numpy‑1.14.2+mkl‑cp35‑cp35m‑win_amd64.whl(笔者是python3.5)
问题解决了。
Windows下Python安装: requires numpy+mkl 和ImportError: cannot import name NUMPY_MKL的更多相关文章
- Windows下Python安装numpy+mkl,Scipy和statsmodels
最近做时间序列分析需要用到Python中的statsmodels,但是安装过程中遇到很头疼的问题,Google.Stackover各种都没有找到合适的解决办法,而且貌似还有很多同学也在吐槽Window ...
- windows下python安装Numpy、Scipy、matplotlib模块(转载)
python下载链接 Numpy下载链接 python中Numpy包的安装及使用 Numpy包的安装 准备工作 Python安装 pip安装 将pip所在的文件夹添加到环境变量path路径中 ...
- windows下python安装Numpy、Scipy、matplotlib模块
来源http://blog.csdn.net/Katrina_ALi/article/details/64922107 http://blog.csdn.net/qq_16633405/article ...
- windows下python安装paramiko
Python中使用SSH需要用到OpenSSH,而OpenSSH依赖于paramiko模块,而paramiko模块又依赖于pycrypto模块,因此要在Python中使用SSH,则需要先安装模块顺序是 ...
- windows下python安装uwsgi
1.使用pip安装 pip install uwsgi 报错:os没有uname() 解决: 定位到uwsgiconfig.py文件中,首先import platform后,将os.unam()都改为 ...
- python机器学习包 Windows下 pip安装 scikit-learn numpy scipy
1.到PIP的目录中C:\Python34\Scripts;2. 2.1 pip安装numpy pip install numpy 2.2 pip安装sklearn pip install -U ...
- windows下python安装Numpy和Scipy模块
安装 numpy: 去 http://sourceforge.net/projects/numpy/files/latest/download?source=files 下载相应的exe安装文件. 安 ...
- Windows下python安装matplotlib
此文为转载,原文地址为:http://blog.csdn.net/u010585135/article/details/42127273 一.下载matplotlib安装包:网址http://matp ...
- Windows下Python安装lxml
1.下载easy_install的安装包,下载地址:https://pypi.Python.org/pypi/setuptools 我是Windows7,所以直接下载Windows(Simplify) ...
随机推荐
- js关于去重的写法
break和continue的区别和作用 break和continue都是用来控制循环结构的,主要是停止循环. 1.break 有时候我们想在某种条件出现的时候终止循环而不是等到循环条件为false才 ...
- 实现mapper接口注入的两种方式,以及后台的使用区别
1.使用模板方式: <!--使用模板类实现mybatis --> <bean id="sqlSession" class="org.mybatis.sp ...
- 基于Confluent.Kafka实现的Kafka客户端操作类使用详解
一.引言 有段时间没有写东西了,当然不是没得写,还有MongoDB的系列没有写完呢,那个系列还要继续.今天正好是周末,有点时间,来写新东西吧.最近公司用了Kafka做为消息的中间件,最开始写的那个版本 ...
- std::move 移动对象资源
场景: C++ 标准库使用比如vector::push_back 等这类函数时,会对参数的对象进行复制,连数据也会复制.这就会造成对象内存的额外创建, 本来原意是想把参数push_back进去就行了. ...
- andorid 单选与复选
activity_ui1.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout x ...
- fedora 使用
我们在这篇指南中将介绍安装Fedora 23工作站版本后要完成的一些实用操作,以便用起来更爽. 1.更新Fedora 23程序包 哪怕你可能刚刚安装/升级了Fedora 23,仍很可能会有需要更新的程 ...
- (转帖)CentOS最常用命令及快捷键整理
原文:http://www.centoscn.com/CentOS/help/2014/0306/2493.html 最近开始学Linux,在VMware Player中安装了CentOS 6.4.为 ...
- centos7 搭建vnc服务
- Ubuntu安装R及R包
安装R $sudo apt-get update $sudo apt-get install r-base $sudo apt-get install r-base-dev 安装一些可能的依赖包 $s ...
- 测试 Open Live Writer
我要试试. 看看图片如何: 这是从电脑端上传的一个例子,如果编辑器里可以支持复制粘贴图片就好了. Open Live Writer 发布以后,还可在保存在本地,想起来的时候就修改一下. 再美化一下. ...