4

Suppose I'm starting a new Python project. Its root directory at the beginning looks like this (for this example it would be a Flask project, but the question applies to any Python project):

myproject
    static
    templates

I want to use virtualenv to create a virtual environment for my project. Where should I create the directory to hold this virtual environment? Should it go inside the root directory of the project, like so?

myproject
    static
    templates
    env
    .gitignore # ignores env

Or should I put the env outside the root directory, like so?

myproject
    static
    templates
env

What is the standard way to do this?

psmears
  • 26,070
  • 4
  • 40
  • 48
Aviv Cohn
  • 15,543
  • 25
  • 68
  • 131

0 Answers0