-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Deploying with pyenv
ZiliKou edited this page May 31, 2017
·
3 revisions
Setting up pyenv on a production server is exactly the same as in development. Some considerations for a hypothetical deployment strategy:
- It is suggested that there is a single user for deployment, e.g. "app" user
-
PYENV_ROOT
is at the default location:~app/.pyenv
- Python versions are either installed or symlinked to
~app/.pyenv/versions
- pyenv version 0.2 or greater is recommended.
Users of Capistrano may find these projects useful:
Interactive, non-interactive shells, cron jobs, and similar processes for the "app" user all must ensure that pyenv is present in the PATH:
export PATH=~/.pyenv/shims:~/.pyenv/bin:"$PATH"
If you use systemd, the PATH must be real PATH, not shims:
Environment=PATH=/home/$USER/.pyenv/versions/$VERSION/bin:$PATH