Search code examples
pythonvirtualenvpyenv

share pyenv environent for any user using the project


Pyenv generates env in user's home folder, which is a problem for sharing environment

  1. I do not want to install NLP and ML packages for each user
  2. I do not want to have more than single point of truth when running a project

I am familiar of separate virtualenv package (and that would be my last resort) but wondering if there is a well-known pyenv strategy on that?


Solution

  • Just set PYENV_ROOT for each user: export PYENV_ROOT="/usr/bin/.pyenv" This will make pyenv store environments in /usr/bin/.pyenv and look for existing environments there. If then user needs to restore default pyenv root they can just unset PYENV_ROOT.