How To Set Pipenv_venv_in_project On Per-project Basis
Solution 1:
To answer this question myself, this is indeed possible!
Short story:
Just create an empty .venv directory yourself. Pipenv will pick this up automaticaly.
Long story:
Note that there are many issues in the pipenv issue tracker that give the wrong impression that the pipenv developers don't want to provide this feature. However, those issues simply describe additional ways to achieve this goal, and those additional ways were declined.
But within that mess, there was one comment that was actually helpful:
techalchemy commented on Dec 12, 2018
Things you can do:
- Simply create the .venv yourself. Pipenv will use it.
- Use a tool like direnv to activate this setting per directory
- Set the envvar globally
- Create a file in the project root called .venv whose contents are only the path to the root directory of a virtualenv
For points 1 and 4, pipenv will pick this up automatically
Note: If you want to use the pipenv
shipped with current Debian/Stable (Buster), point 4 won't work, as this feature was introduced in a later pipenv
version. However, point 1 works perfectly well. For Python 3, this means:
python3 -m virtualenv -p python3 .venv
pipenv install ... # resp. pipenv sync
Post a Comment for "How To Set Pipenv_venv_in_project On Per-project Basis"