pythonvirtualenv

Creating a virtualenv with preinstalled packages as in requirements.txt


Creating a virtualenv will create a virtual python environment with preinstalled pip, setuptools and wheels.

Is there a way to specify what packages to pre-install in that virtualenv apart from those 3 default ones? Either with CLI arguments, a file, or environment variables of some sort.

I.e. is there something along the lines of virtualenv venv && venv/bin/pip install -r requirements.txt which can be run in one command?


Solution

  • Typically the steps you always takes are: