Hacker News new | ask | show | jobs
by yrro 2886 days ago
It uses virtualenv, rather than venv.

After discovering PYTHONUSERBASE, I no longer need any of the plethora of wrappers around venv/virtualenv.

2 comments

>After discovering PYTHONUSERBASE, I no longer need any of the plethora of wrappers around venv/virtualenv.

Is there any walkthrough available? Pipenv has one deficiency is that it can be slow at times, particularly when you want to quickly install a dependency and run. Would love to know the alternative.

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUS...

Set the environment variable to a different directory for each project, and `python3 -m pip install whatever` will go into that directory.

How do you use PYTHONUSERBASE?

    $ export PYTHONUSERBASE=/path/to/project-specific-python-user-base
    $ python3 -m pip install --user whatever
Everything now goes into that directory. Different projects on the same machine have different directories and so can't affect one another.