1 comment

[ 3.0 ms ] story [ 16.2 ms ] thread
this whole notion of "activating" a venv really does cause more confusion and obfuscation than it solves. How?

Using it this way, without an "activate" step makes things plainer.

    python3.11 -m venv .venv/
    .venv/bin/python3 -m pip install --requirement etc/pip/requirement.txt
    .venv/bin/python3 -m pip freeze > etc/pip/requirement3.11.txt

    export PYTHONPATH=$(pwd)/src/python
    venv/bin/python3 -m mycorp.myapp.main

This notation can then be used in wrapper scripts in the project. Encouraging people to experiment in the shell without simultaneously and immediately making them reusable in scripts may lead to a "works-on-my-computer" attitude.