根据字面意思理解,一直以为是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
至此,花费半个下午的时间终于将需要的库安装成功。
pycharm中导入模块错误时提示Try to run this command from the system terminal. Make sure that you use the......
最新推荐文章于 2025-12-19 18:35:24 发布
博主通过错误提示发现PyCharm的Python路径,并在此路径下使用命令行安装matplotlib、keras、tiffile和tensorflow等库。他们利用豆瓣国内源加速下载,成功解决了因pip版本引起的安装问题。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
TensorFlow-v2.15
TensorFlow
TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型
2805

被折叠的 条评论
为什么被折叠?



