Home python Connecting modules to PyCharm

Connecting modules to PyCharm

Author

Date

Category

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.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions