do I user the same "user" for each virtual env?

71 views
Skip to first unread message

greg

unread,
Mar 11, 2018, 4:47:01 PM3/11/18
to virtualenvwrapper
Is the idea to use the same linux user for each of the virtual environment?

Background: Working with python 3.  I did setup different users for my current two virtualenv's but being newish to linux/python it's a bit of nuisance and confusing swapping between environments, users etc.  So wondering if best practice is followed whether I should be creating a new linux user and home for each virtual environment and project.  Or whether I can drop this.  e.g. of 

- /srv
  - /venvA [user A]
  - /venvB [user B]
- /home
  - /userA
     - project source files
  - /userB
     - project source flles


Doug Hellmann

unread,
Mar 12, 2018, 9:02:14 AM3/12/18
to virtualenvwrapper
Excerpts from greg's message of 2018-03-11 13:47:01 -0700:
Virtualenvwrapper is meant to be a tool for a single user to create
multiple virtualenvs. We have had folks use it the way you're
suggesting, but it's not necessary and as you have found it makes
using it a bit of a pain.

I recommend sticking to the default values for settings like
WORKON_HOME unless you have a strong need for an alternative.

Doug

Mick T.

unread,
Mar 13, 2018, 10:18:05 AM3/13/18
to virtualenvwrapper
I agree with Doug, sharing virtualenv's can be tricky. If you really want to do it, then you'll need one user with read/write access to install packages into the virtualenvs and then the other users only source the environment. But that's hardly worth the bother when one can simply and easily run and update their own virtualenv.

--Mick 

Doug Hellmann

unread,
Mar 14, 2018, 8:44:13 AM3/14/18
to virtualenvwrapper
Excerpts from Mick T.'s message of 2018-03-13 07:18:05 -0700:
Yes, if you just want to share the configuration of the environments I
recommend using requirements.txt files with specific version settings
(you can generate one of those with "pip freeze" after you have an
environment configured the way you want it).

Doug

greg

unread,
Mar 14, 2018, 8:54:56 AM3/14/18
to virtualenvwrapper
Ok, thanks guys
Reply all
Reply to author
Forward
0 new messages