导入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.
解决方法:
这种问题一般是由于环境变量的配置问题导致程序在引用模块的时候发生了错误。
添加下面三个环境变量即可解决:
原文来自:https://www.py.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容