Can't find the modules that have been installe

2019-01-28 12:22发布

问题:

I use PyCharm, normally I install 3rd party libraries with the Project Interpreter in PyCharm. Today I installed plotly by running pip install plotly==2.7 in the terminal. 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'

回答1:

I figured out where the problem is.
pip installs packages under python2.7/site-packages
pip3 installs packages under python3.6/site-packages

So I should use pip3 install plotly==2.7 since I'm using Python3.6