0

I have been recommended to follow PEP370 instead of creating virtualenvs.

http://legacy.python.org/dev/peps/pep-0370/

Can anyone explain which is a better solution? It seems virtualenvs are redundant since python 2.6.

Jimmy
  • 12,087
  • 28
  • 102
  • 192

1 Answers1

1

From that PEP (emphasis added):

Current Python versions don't have a unified way to install packages into the home directory of a user (except for Mac Framework builds). Users are either forced to ask the system administrator to install or update a package for them or to use one of the many workarounds like Virtual Python [1], Working Env [2] or Virtual Env [3].

It's not the goal of the PEP to replace the tools or to implement isolated installations of Python. It only implements the most common use case of an additional site-packages directory for each user.

PEP370 solves a similar but still different problem from virtualenv. PEP370 is about a per-user installation, but that doesn't solve the same problems as virtualenv, which creates environments independent of system or user. I suppose you could use PEP370 to replace virtualenv, but that would mean creating a new user account for every new environment you wanted and being very careful to never modify the base istallation, which isn't exactly an easy to use or maintain system.

Silas Ray
  • 25,682
  • 5
  • 48
  • 63
  • I create a user account on my server for every environment (for security, not to replace virtualenvs), and I never had any issue with it yet. – Valentin Lorentz Mar 06 '14 at 15:32
  • So every time you want to try out a new library or work on a different project that you'd like to sandbox within your dev environment, you create a new user account? There's a difference between a sys admin use case and a developer use case. – Silas Ray Mar 06 '14 at 15:36