Doubts about virtualenv

Asked

Viewed 282 times

3

I’m starting development with virtualenv and some doubts have arisen, are they:

  1. Python scripts need to be inside the virtual environment folder?
  2. In the Pycharm IDE, you need to configure something to develop in the enabled virtual environment?
  3. If I need to run the scripts on another machine that does not have the virtual environment configured, I need to configure it from scratch?

1 answer

3


The answer to the first question is: No! and it seems to make no sense, what I see (and no use) is the contrary, to venv be in a directory inside your project.

Yes, No pycharm vc need to tell which venv your project will work with, cofigure in File/Settings/project interpreter.

Configurando o pycharm

The answer to the third question is: Not necessarily! The concept of virtual env á for the developer, so that he can have several development environments in his workstation, in this way one can develop projects in python 2, python 3, etc, just to "commute" the environments.

On the machine that will run the project you need to have all the packages required by it, whether or not in a virtual env. For this use a requirement file, commonly called Reskirts.txt

To start managing virtual environments in python, consider using anaconda. See, here at Stopt, that answer, and open this door with a golden key. :-)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.