Recently, I wrote an article about “installation and use of Microsoft open source distributed high performance GB framework lightgbm”. Some partners encountered problems when installing Python environment. I personally tried to install it, and I really encountered a lot of problems“ After the problem of “installing the SciPy Library of Python under Windows 7” was solved, we encountered “importerror: cannot import name numpy”_ MKL. As follows:
[plain]
view plain
copy
D:\LightGBM\LightGBM\examples\python-guide> pythonsimple_ example.py
Traceback(mostrecentcalllast):
File”simple_ example.py”,line4,in< module>
importlightgbmaslgb
File”D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\__ init__. p
y”,line9,in< module>
from.basicimportDataset,Booster
File”D:\Python27\lib\site-packages\lightgbm-0.1-py2.7.egg\lightgbm\basic.py”,
line15,in< module>
importscipy.sparse
File”D:\Python27\lib\site-packages\scipy\__ init__. py”,line61,in< module>
fromnumpy._ distributor_ initimportNUMPY_ MKL#requiresnumpy+mkl
ImportE rror:cannotimportnameNUMPY_ MKL
Why is there such a problem
Reference“ http://stackoverflow.com/questions/37267399/importerror-cannot-import-name-numpy-mkl ”What I’m saying is
Because my “SciPy” is installed with “. WHL” file according to the method in “installation of Python’s SciPy Library under Windows 7”, and “numpy” is installed with “PIP install numpy” command
In fact, I used the “PIP install numpy” command to install. In fact, I downloaded a “. WHL” file, which is different from the download source of “SciPy”, but it doesn’t work
What to do?What to do
Unload numpy with the command “PIP install numpy” and MKL with the command “PIP install MKL”
Using the same source as “SciPy”, from“ http://www.lfd.uci.edu/~gohlke/pythonlibs/ ”Download the installation file of “numpy” (find the corresponding version)
Then use the command to install: PIP installnumpy {1.14.2 + MKL} cp35} cp35m} win_ AMD64. WHL
The problem is solved