导入anaconda中库报错的原因与解决方法

图片[1]-导入anaconda中库报错的原因与解决方法-uusu优素-乐高,模型,3d打印,编程

导入Anaconda中的第三方库运行时报错:ImportError: Missing required dependencies ['pandas']

推荐:anaconda使用教程

保留的报错信息:

D:\Anaconda\envs\py2\python.exeE:/PythonTest/NaiveBayesian.py
Traceback(mostrecentcalllast):
File"E:/PythonTest/NaiveBayesian.py",line2,in<module>
importnumpyasnp
File"D:\Anaconda\envs\py2\lib\site-packages\numpy\__init__.py",line142,in<module>
from.importcore
File"D:\Anaconda\envs\py2\lib\site-packages\numpy\core\__init__.py",line71,in<module>
raiseImportError(msg)
ImportError:
IMPORTANT:PLEASEREADTHISFORADVICEONHOWTOSOLVETHISISSUE!
Importingthemultiarraynumpyextensionmodulefailed.Most
likelyyouaretryingtoimportafailedbuildofnumpy.
Hereishowtoproceed:
-Ifyou'reworkingwithanumpygitrepository,try`gitclean-xdf`
(removesallfilesnotunderversioncontrol)andrebuildnumpy.
-Ifyouaresimplytryingtousethenumpyversionthatyouhaveinstalled:
yourinstallationisbroken-pleasereinstallnumpy.
-Ifyouhavealreadyreinstalledandthatdidnotfixtheproblem,then:
1.CheckthatyouareusingthePythonyouexpect(you'reusingD:\Anaconda\envs\py2\python.exe),
andthatyouhavenodirectoriesinyourPATHorPYTHONPATHthatcan
interferewiththePythonandnumpyversionsyou'retryingtouse.
2.If(1)looksfine,youcanopenanewissueat
https://github.com/numpy/numpy/issues.Pleaseincludedetailson:
-howyouinstalledPython
-howyouinstallednumpy
-youroperatingsystem
-whetherornotyouhavemultipleversionsofPythoninstalled
-ifyoubuiltfromsource,yourcompilerversionsandideallyabuildlog
Note:thiserrorhasmanypossiblecauses,sopleasedon'tcommenton
anexistingissueaboutthis-openanewoneinstead.

解决方法:

这种问题一般是由于环境变量的配置问题导致程序在引用模块的时候发生了错误。

添加下面三个环境变量即可解决:

图片[2]-导入anaconda中库报错的原因与解决方法-uusu优素-乐高,模型,3d打印,编程

原文来自:https://www.py.cn
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容