这篇文章将为大家详细讲解有关导入Anaconda中的第三方库运行时报错怎么办,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

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

保留的报错信息:

D:\Anaconda\envs\py2\python.exeE:/PythonTest/NaiveBayesian.pyTraceback(mostrecentcalllast):File"E:/PythonTest/NaiveBayesian.py",line2,in<module>importnumpyasnpFile"D:\Anaconda\envs\py2\lib\site-packages\numpy\__init__.py",line142,in<module>from.importcoreFile"D:\Anaconda\envs\py2\lib\site-packages\numpy\core\__init__.py",line71,in<module>raiseImportError(msg)ImportError:IMPORTANT:PLEASEREADTHISFORADVICEONHOWTOSOLVETHISISSUE!Importingthemultiarraynumpyextensionmodulefailed.Mostlikelyyouaretryingtoimportafailedbuildofnumpy.Hereishowtoproceed:-Ifyou'reworkingwithanumpygitrepository,try`gitclean-xdf`(removesallfilesnotunderversioncontrol)andrebuildnumpy.-Ifyouaresimplytryingtousethenumpyversionthatyouhaveinstalled:yourinstallationisbroken-pleasereinstallnumpy.-Ifyouhavealreadyreinstalledandthatdidnotfixtheproblem,then:1.CheckthatyouareusingthePythonyouexpect(you'reusingD:\Anaconda\envs\py2\python.exe),andthatyouhavenodirectoriesinyourPATHorPYTHONPATHthatcaninterferewiththePythonandnumpyversionsyou'retryingtouse.2.If(1)looksfine,youcanopenanewissueathttps://github.com/numpy/numpy/issues.Pleaseincludedetailson:-howyouinstalledPython-howyouinstallednumpy-youroperatingsystem-whetherornotyouhavemultipleversionsofPythoninstalled-ifyoubuiltfromsource,yourcompilerversionsandideallyabuildlogNote:thiserrorhasmanypossiblecauses,sopleasedon'tcommentonanexistingissueaboutthis-openanewoneinstead.

解决方法:

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

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

关于导入Anaconda中的第三方库运行时报错怎么办就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。