3

I'm very new to Linux so it could be that I think more in a Windows way.

I want to develop something in Python, especially Django and Discord Bot. I have a folder PythonEnvironment where I set up a Python Venv called pyvenv. Now I want to install "discord.py" and asked myself: Should I set up for discord.py its own Venv (e.g. discordvenv) and for Django its own Venv (e.g. djangovenv), or just install everything in one Venv?

And when I installed everything I need, can I just start programming in PyCharm like in Windows, or must I do something more e. g. tell Pycharm to work in a specific Venv?

4

Start programming in PyCharm like in Windows and install everything that belongs to the current project in one venv. Whenever you install a Python package specifically for a project, PyCharm adds the packages that were installed to the project's venv where PyCharm will find them automatically.

If any of the project's Python packages are installed from the default Ubuntu repositories PyCharm will find them automatically too, if you select the Inherit global-site packages option when you create a new project.

Select File -> New Project to create a new project. Click the triangle marked by the mouse cursor in the below screenshot to show the new project's options.

Create Project

Then check the Inherit global-site packages checkbox and click the Create button in the lower right corner of the Create Project window.

Create Project options

  • So i can just start programming without say pycharm where my venv is? – 黒성배 Dec 14 '19 at 13:36
  • When you create a new project PyCharm will automatically create a new venv for that project. Whenever you install a Python package specifically for that project, PyCharm adds the packages that were installed to the project's venv. PyCharm also knows the location of that venv without you needing to tell it where the venv is. – karel Dec 14 '19 at 13:46
  • Ok, so I make a new project and in this project I install via Terminal in Pycharm everything I need? I don't need to install something in an own created Venv, did I get it right? – 黒성배 Dec 14 '19 at 14:23
  • It's too hard to install everything you need in PyCharm via the terminal. That's why I gave you a link to an official PyCharm webpage in the preceding comment to tell you how to do that in PyCharm the easy way. That way PyCharm knows where to find everything that it installed. – karel Dec 14 '19 at 14:28
  • Oh lol, didn't noticed this Link. Thanks, you helped me a lot ^^ – 黒성배 Dec 14 '19 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.