解决conda虚拟环境中importerror: numpy.core.multiarray failed to import

#报错信息如下:
解决conda虚拟环境中importerror: numpy.core.multiarray failed to import

解决方法一

  1. conda update --all
  2. 接下来是一大堆的更新,最后,“done”
  3. 进入anaconda的virtualenv中看一看numpy的版本
  4. 解决conda虚拟环境中importerror: numpy.core.multiarray failed to import
  5. numpy成功更新
  6. 然鹅,我在执行以下代码时仍然上述错误
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

解决!

相关文章:

  • 2022-03-02
  • 2022-12-23
  • 2021-07-19
  • 2021-11-21
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
猜你喜欢
  • 2021-11-16
  • 2021-06-17
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
相关资源
相似解决方案