Skip to main content

Shortcut from virtualenv to venv for python2

Project description

Provides a simple “shortcut” from virtualenv to venv on python 2.

Pretty much everything I do is in python3, where I use venv for every single project I work on.

Occasionally I need my CI to also test / build / deploy to python2 as well. As is stands, I generally end up with annoyingly complex startups scripts in ci that has to check which version is being being run and then either use python -m venv .venv on 3 or python -m pip install virtualenv; python -m virtualenv .venv for 2.

It would be much better if I could just use python -m venv .venv everywhere, but venv has not been backported. This package is a pretty decent workaround.

py2venv can be pre-installed on any python. On python3 it does nothing. On python 2 it ensures virtualenv has been installed and provides a ‘venv’ module entrypoint:

python -m pip install py2venv
python -m venv .venv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py2venv-1.1.tar.gz (2.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page