在tensorflow环境中运行程序时,会遇到这样的错误:ModuleNotFoundError: No module named 'xxx’
以ModuleNotFoundError: No module named 'pandas’为例,出现这样的问题是因为所创建的环境中没有安装pandas包(其他包也可以按照下面的方法下载)  又以ModuleNotFoundError: No module named 'matplotlib’为例,出现这样的问题是因为所创建的环境中没有安装matplotlib包 
解决方案:
(以ModuleNotFoundError: No module named 'pandas’为例)
1.打开Anaconda Navigator,进入tensorflow的安装环境(如下图中的tensorflow是安装在名称为tensorflow2的环境中)  2.选择Not Installed,右边输入没有安装的包的名字(如pandas),然后在目录中选择要安装的包,最后点击Apply  3.点击Apply 
等待安装完成即可  然后再运行程序,就会发现没有ModuleNotFoundError: No module named 'xxx’的错误了
|