当我想在cmd上打开jupyter notebook时,使用以下命令:"jupyter notebook"我得到一个错误,即:导入_device时DLL加载失败我该如何解决这个问题?
我今天遇到了同样的问题,我的python版本是Python3.9 from anaconda,而我的NumPy版本是1.22.3。
我尝试用
重新安装ipython和ipykernelpip install --upgrade ipykernel
conda uninstall ipykernel
python -m pip install ipykernel
和nb_conda
conda install nb_conda
但是它不能很好地工作,然后我注意到,当我导入NumPy时,它给出两种类型的错误:DDL load failed while importing _device
和DDL load failed while importing XXX
例如:
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "D:anacondaenvssample1python.exe"
* The NumPy version is: "1.22.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath
所以我检查了它们的版本,发现它们不兼容,然后我尝试从http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy安装numpy-1.22.4+mkl-cp39-cp39-win_amd64.whl
版本(选择适合您的python版本和系统),而不是在Anaconda提示符中使用conda install
,在我重新安装Numpy 1.22.4后,我可以导入Numpy并使用Jupyter Notebook。