I'm trying to make a runnable Python script with a custom virtual environment.
Instead of activating the virtual environment or specifying the full path I tried to use ~ in the shebang line.
Does not work out (expected):
#!~/path/to/bin/pythonand running the script as./script.py.Does not work out (lacks
pipdependencies):#!/full/path/to/bin/pythonand running the script as./script.py.Works out:
No shebang line and running the script as~/path/to/venv/bin/python script.py.