Install Python

CentOS 7


- Install "pyenv" (Python environmental manager)
yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
git clone https://github.com/yyuu/pyenv.git ~/.pyenv

- Add the following lines to the ".bashrc" file
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

- activate new ".bashrc" file
source .bashrc
pyenv version

- Install Anaconda package (replace x.x.x by appropriate version numbers)
pyenv install --list
pyenv install anaconda3-x.x.x
pyenv versions
pyenv global anaconda3-x.x.x
pyenv rehash
python --version
pyenv versions

# see GeoCAT web page
https://geocat.ucar.edu/pages/software.html

Ubuntu 18.04


- Install "pyenv" (Python environmental manager)
sudo apt-get install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
git clone https://github.com/yyuu/pyenv.git /usr/local/pyenv

- Add the following lines to the ".bashrc" file
# pyenv
export PYENV_ROOT="/usr/local/pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

- activate new ".bashrc" file
source .bashrc
pyenv version

- Install Anaconda package (replace x.x.x by appropriate version numbers)
pyenv install --list
pyenv install anaconda3-x.x.x
pyenv versions
pyenv global anaconda3-x.x.x
pyenv rehash
python --version
pyenv versions

ln -s /usr/local/pyenv/shims/python3 /usr/local/bin/python3