Search code examples
pythonvirtualenvnaming-conventionsvirtual-environment

The naming rules for your virtual environments in Python


I'm looking for some sort of naming scheme for my virtual environments.

  • How do you usually name them?
  • Is there naming convention for python virtual environments?

Solution

  • If you are storing your environment inside the project folder some common names are env, venv, .env, .venv, but besides that, I don't think there are any common conventions.

    The official docs.python.org's tutorial on venv also suggests using .venv as the name.

    A common directory location for a virtual environment is .venv.

    This name keeps the directory typically hidden in your shell and thus out of the way while giving it a name that explains why the directory exists.

    It also prevents clashing with .env environment variable definition files that some tooling supports.

    - docs.python.org/3/tutorial/venv.html