

That you want to run myapp.py with the environment’s Python Running Python scripts like this is possible because venv-run guesses If myapp.py accepts arguments, you can pass them normally: $ venv-run myapp.py -foo -bar baz You can call a Python script of your project using that environment with the Virtual environment like the example below: $ cd my-python-project $ python -m venv myvenv Suppose you have a Python project in my-python-project and have created a Path prepended to the system’s binary path.Īll the examples in this section assume you have a virtual environment created The environment’s directory, it runs your command with the environment’s binary Virtual environment under your current working directory. When called, the first thing venv-run does is to look for a (single) Venv-run can be called directly as a shell command: venv-run Packagers): python setup.py install Usage Not provide an “uninstall” command (this form is useful for OS distribution Install from source is doing: # From the source rootĪlternatively, you can call setup.py directly, but remember that it does If you have pip available in your system, then the recommended way to Installation Using pip pip install venv-run From source Your current working directory so you can save some typing. Another nice thingĪbout venv-run is that it tries to find the environment’s directory from

Prepended to the system’s PATH environment variable. Without explicitly activating it (and deactivating it when you are done).Įssentially it runs your command with the virtual environment’s binary path Venv-run is a tool for running commands with a Python virtual environment

Locally installing and using a Python package That is the main motivation of this tool! …is more convenient than this… source myvenv/bin/activate python myapp.py deactivate
