在 PyCharm 中找不到模块错误,但它是作为 Anaconda 包安装的 [英] Module not found error in PyCharm , but it is installed as Anaconda package

查看:53
本文介绍了在 PyCharm 中找不到模块错误,但它是作为 Anaconda 包安装的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之后我安装了 Anaconda 3 和 PyCharm CE.我可以选择解释器作为 Conda 环境.但是当我尝试使用某些包(例如 matplotlib)时,它会抛出Module not found error".当我运行 pip 时,它返回说 matplotlib 可用.

I have installed Anaconda 3 and PyCharm CE after that. I am able to chose the interpreter to be Conda environment. But when I try using certain packages such as matplotlib it throws "Module not found error". When I run pip it returns saying that matplotlib is available.

pip install matplotlib
Requirement already satisfied: matplotlib in./anaconda3/lib/python3.6/site-packages

很明显,包裹在那里,但由于某种原因它没有显示出来.

Clearly the package is there and for some reason it does not show up.

推荐答案

显然选择的命名取决于操作系统,但是Python解释器可以选择如下:

Apparently the naming of the selection depends on the operating system, but the Python interpreter can be selected as follows:

  • 文件 >首选项 >项目>Python 解释器 (MacOS)
  • 文件 >设置 >项目>Python 解释器(Windows、Linux)
  • File > Preferences > Project > Python Interpreter (MacOS)
  • File > Settings > Project > Python Interpreter (Windows, Linux)

使用下拉菜单选择正确的 Python 解释器.根据您的操作系统和设置,这可以是默认解释器(例如 ~/anaconda3/bin/python)或对应于您选择的 Conda 环境的解释器(例如 C:users用户名.condaenvsprojectnamepython.exe).

Using the dropdown select the right Python interpreter. Depending on your OS and setup this can be the default interpreter (e.g. ~/anaconda3/bin/python) or the interpreter corresponding to the Conda environment of your choice (e.g. C:usersusername.condaenvsprojectnamepython.exe).

现在应该列出所有随 Anaconda 安装的软件包.

Now all the packages installed with Anaconda should be listed.

这篇关于在 PyCharm 中找不到模块错误,但它是作为 Anaconda 包安装的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆