Installed the requests
module for python via PIP
.
Everything works in the terminal through the python3 interpreter:
& gt; & gt; & gt; import requests
& gt; & gt; & gt; r = requests.get ('http://google.com')
& gt; & gt; & gt; print (r.text)
But PyCharm does not see the connected module with the same code. How to let him know that he is?
OS: Ubuntu 18.04
Answer 1, authority 100%
1) To connect modules go to File->Settings->Interpreter
2) Find the “+” icon
3) We are looking for the required module, install it. Confirm changes, reload with PyCharm firewall settings
3) Profit
Answer 2, authority 25%
your project has its own venv virtual environment. All packages that you would like are put there. Therefore, in addition to the option above (which you were advised), right in the Terminal of the IDE itself (and it will already be launched with your virtual environment), install the required package in the usual way for you:
(venv) xxxxx @ yyyy: ~ / PycharmProjects / my_project $ pip ......
All installed packages in this way will also be displayed in the Project Interpreter after installing PyCharm itself from the Terminal with the current virtual environment of your project.