我在Visual Studio代码中使用Anaconda 5.3.0的Python解释器。当我试图导入sklearn时,我得到一个错误:Traceback (most recent call last):
File "c:\Users\azzam\machinelearning.py", line 1, in
import sklearn
File "C:\Anaconda3\lib\site-packages\sklearn\__init__.py", line 134, in
from .base import clone
File "C:\Anaconda3\lib\site-packages\sklearn\base.py", line 10, in
import numpy as np
File "C:\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in
from . import add_newdocs
File "C:\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "C:\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in
from .type_check import *
File "C:\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in
import numpy.core.numeric as _nx
File "C:\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
看起来我需要“重新安装”NumPy。我在网上搜索,但没有找到“重新安装”的方法。只有当我使用conda install numpy
在水蟒的提示下我得到:Solving environment: done
# All requested packages already installed.
如果我试图删除NumPy来再次安装它,它将删除所有内容,而不仅仅是NumPy。所以我真的需要“重新安装”NumPy才能导入sklearn?
如果我这样做了,我该如何“重新安装”NumPy?