pycharm中导入模块错误时提示Try to run this command from the system terminal. Make sure that you use the...

参考该篇博客,在pycharm工作路径中下载安装需要的模块。

 

 

 

 

 


根据字面意思理解,一直以为是pip版本不对导致的,于是花费时间在更新pip版本上。
根据导入模块时错误提示信息可以看出,我的pycharm路径为C:\Users\Administrator.USER-20190620KX\PycharmProjects\untitled20\Scripts。在该径路下打开命令窗口,输入python.exe -m pip install matplotlib -i http://pypi.douban.com/simple --trusted-host pypi.douban.com。(豆瓣国内源)。可以看出,输入完毕后,之前只有numpy、pip以及setuptools三个库,现在多出6个包。一定要在错误中提示的路径下安装导入所需模块。
如法炮制,把matplotlib替换成你所需要安装的库就可以了。
python.exe -m pip install keras -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python.exe -m pip install tiffile -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python.exe -m pip install tensorflow -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

至此,花费半个下午的时间终于将需要的库安装成功。

posted @ 2020-06-20 13:51  韩昊  阅读(19988)  评论(0编辑  收藏  举报