Skip to content

Instantly share code, notes, and snippets.

@ressu
Created July 31, 2015 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ressu/c748ad4e4e3be1c42d83 to your computer and use it in GitHub Desktop.
Save ressu/c748ad4e4e3be1c42d83 to your computer and use it in GitHub Desktop.

Installing python through pyenv

Pyenv is a tool to install and manage side by side python installations. It's generally used for development, but can be used for production environments as well.

Installing pyenv is simple, we can use the installer. The installer installs pyenv to ~/.pyenv along with tools to build various python versions.

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

Follow the instructions given by the installer on how to enable the pyenv command.

You will also need the common build tools for python environments, more details here: https://github.com/yyuu/pyenv/wiki/Common-build-problems

Install a python environment by running:

pyenv install 2.7.10

After that you can select a python version to run by going to the sickgear installation directory and running

pyenv local 2.7.10
pip install -r requirements.txt

The latter command is used to install all the dependencies. Since pyenv installs a separate installation of python, your system modules are unavailable inside the pyenv python installation.

If you wish to run sickgear as a daemon, you need to set the python binary to point to the python shim, and it will automatically pick the right python to run (based on the local selection). The shim path is in the .pyenv directory, for example: /home/sickgear/.pyenv/shims/python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment