Install pyenv

Pyenv allows you to easily control your python environment.  The TechTeam recommends that you set your biotite globally to Python 3, and set subdirectories to Python 2 when scripts require it.

Thorough documentation and instructions on pyenv are here:

https://github.com/pyenv/pyenv

 

Quick start instructions for biotite:

(Shortened from “Basic GitHub Checkout” on https://github.com/pyenv/pyenv)

  1. Checkout from GitHub in the directory you wish to install. We recommend home directory:

     $ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
  2. Add to bash profile:
    $ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
    $ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile 
    
  3. Add pyenv init to your shell to enable shims and autocompletion. Please make sure eval "$(pyenv init -)"is placed toward the end of the shell configuration file since it manipulates PATH during the initialization.
    $ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

    Note: There are some systems where the BASH_ENV variable is configured to point to .bashrc. On such systems you should almost certainly put the above mentioned line eval "$(pyenv init -)" into .bash_profile, and not into .bashrc. Otherwise you may observe strange behaviour, such as pyenv getting into an infinite loop. Make sure to check this because of the new ubuntu installation (Jan 2018.)

  4. Restart your shell so the path changes take effect. You can now begin using pyenv.
    $ exec "$SHELL"

 

Examples of use:

  1. Install Python versions into $(pyenv root)/versions:

    $ pyenv install 3.6.4
    $ pyenv install 2.7.8
  2. See what versions you have installed. Asterisk indicates the one set in your environment:
    $ pyenv versions
    2.7.13
    * 3.6.1 (set by /Users/home/.pyenv/version)
    
  3. See what version of python is running in your current location:
    $ pyenv version 
    3.6.1 (set by /Users/home/.pyenv/version)
    
  4. Set global python environment:
    $ pyenv global 3.6.1
  5. Set local python environment (a subdirectory for example):
    /subdirectory$ pyenv local 2.7.13
  6. Run multiple python environments in path
     For programs like dRep whose dependencies have programs that use python 2 and 3, you need to have multiple versions available in your path.

    $ pyenv global 3.6.1 2.7.13
  7. Help?
    $ pyenv -h