解决conda虚拟环境中importerror: numpy.core.multiarray failed to import
#报错信息如下:
解决方法一
- conda update --all
- 接下来是一大堆的更新,最后,“done”
- 进入anaconda的virtualenv中看一看numpy的版本
- numpy成功更新
- 然鹅,我在执行以下代码时仍然上述错误
import nltkfrom nltk.corpus
import inauguralcfd=nltk.ConditionalFreqDist((target,fileid[:4])
for fileid in inaugural.fileids()
for w in inaugural.words(fileid)
for target in ['american','citizen']
if w.lower().startswith(target) )
cfd.plot()
解决方法二
在virtualenv的python下
print(numpy.__path__)
numpy的安装包路径就会显示出来,进到文件夹这个路径里,把与numpy有关的三个包全部删除
numpy
dist-info
egg-info
然后重新进到virtualenv中
pip install numpy
解决!