简体   繁体   English

找不到pip已经安装的模块

[英]Can't find the modules that have been installed by pip

I use PyCharm, normally I install 3rd party libraries with the Project Interpreter in PyCharm.我使用 PyCharm,通常我在 PyCharm 中使用Project Interpreter安装 3rd 方库。 Today I installed plotly by running pip install plotly==2.7 in the terminal.今天我plotly安装运行pip install plotly==2.7的终端。 But when I tried to import it, I got an unresolved reference 'plotly' warning in the editor.但是当我尝试导入它时,我在编辑器中收到了一个未解决的参考“情节”警告。 How can I solve it?我该如何解决?
I got this error when I run the code ModuleNotFoundError: No module named 'plotly'当我运行代码ModuleNotFoundError: No module named 'plotly'时出现此错误

I figured out where the problem is.我想出了问题出在哪里。
pip installs packages under python2.7/site-packages pippython2.7/site-packages下安装python2.7/site-packages
pip3 installs packages under python3.6/site-packages pip3python3.6/site-packages下安装python3.6/site-packages

So I should use pip3 install plotly==2.7 since I'm using Python3.6所以我应该使用pip3 install plotly==2.7因为我使用的是 Python3.6

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM