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
Similar Posts:
- [Solved] “import numpy as np” ImportError: No module named numpy
- Solution for oserror: [errno 1] operation not permitted encountered when installing tensorflow
- numpy.distutils.system_info.NotFoundError: no lapack/blas resources found problem solved
- [Solved] Importerror: DLL load failed while importing mtrand: the specified program could not be found.
- Pythonmodule ‘scipy.misc’ has no attribute ‘xxx’
- [Solved] pip Install Error: is not a supported wheel on this platform
- [Solved] pytorchImportError: numpy.core.multiarray failed to import
- Solve the problem of Attributeerror: module ‘SciPy. Misc’ has no attribute ‘imread’
- Pycharm introduces numpy error: ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy.
- Mac OS uses pip to install pandas prompt cannot install ‘numpy’ solution