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) ...
随机推荐
- 30-算法训练 最短路 spfa
http://lx.lanqiao.cn/problem.page?gpid=T15 算法训练 最短路 时间限制:1.0s 内存限制:256.0MB 问题描述 给定一个n个顶点, ...
- 关于SharedPreferences存储数据的使用方法
SharedPreferences是Android中最容易理解的数据存储技术,实际上SharedPreferences处理的就是一个key-value(键值对)SharedPreferences常用来 ...
- istio-jaeger-python调用链配置
虽然,istio ingress controller已经生成了jaeger 记录所需要的信息,但是多个分布式之间没法清晰记录相互之间的依赖关系.所以相关的项目还需要加入特殊配置. 如:python- ...
- (转)android拨打电话崩溃6.0以上实时动态权限申请
文章转自:http://blog.csdn.net/qq_29988575/article/details/54909213 6.0以下手机正常,6.0以上的却崩溃 解决方法: targetSdkVe ...
- centos7.2下nginx安装教程
1.准备工作 1)关闭iptables 关闭操作 iptables -t nat -F 查看操作 iptables -t nat -L 2)关闭selinux 查看操作 setenforce 关闭操作 ...
- 抽象类,override,final和类模板
抽象类: **有些函数由于信息不够具体,而无法实现** 由此而来的纯虚函数:在基类中声明的纯虚函数,在基类中无法实现(是因为在基类中定义的信息不够具体,不是学的知识不够),于是这个函数没办法规定具体的 ...
- andorid UI事件 监听器
gridlayout.xml <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns ...
- tesseract-ocr如何训练Tesseract 4.0
引自:https://blog.csdn.net/huobanjishijian/article/details/76212214 原文:https://github.com/tesseract-oc ...
- QueryRunner类的八种结果处理集
package cn.jy.demo; import java.sql.Connection; import java.sql.SQLException; import java.util.List; ...
- from collections import namedtuple 使用
from collections import namedtuple Point = namedtuple('Point', ['x', 'y'])#本质就是等价于 class Point(): # ...