apt-get update
adduser jnmclarty
usermod -aG sudo jnmclarty
su - jnmclarty
sudo apt-get -y upgrade
sudo apt-get install make build-essential libssl-dev libffi-dev python-dev python-virtualenv zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
nano ~/.bash_profile
add:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
Despite the instructions saying to add to ~/.bash_profile
nano ~/.bashrc
add:
export PATH="/home/jnmclarty/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Restart the session.
Check:
python --> Python 2.7.12
python3 --> Python 3.5.2
pyenv --> Should show commands
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh
Do you approve the license terms? [yes|no]
>>> 'yes'
[/home/you/anaconda3] >>> enter
Do you wish the installer to prepend the Anaconda3 install location
>>> 'yes'
This adds to ~/.bashrc:
# added by Anaconda3 4.2.0 installer
export PATH="/home/jnmclarty/anaconda3/bin:$PATH"
Comment out the export, leave it there for explicitness
nano ~/.use_anaconda
add:
export PATH="/home/jnmclarty/anaconda3/bin:$PATH"
(Each section is from fresh shell)
pyenv
pyenv install --list
pyenv install 3.6.0
pyenv install 2.7.13
pyenv install 3.5.2
pyenv versions
pyenv local 3.6.0 2.7.13
python
/home/jnmclarty/.pyenv/versions/3.6.0/lib/python36.zip
/home/jnmclarty/.pyenv/versions/3.6.0/lib/python3.6
/home/jnmclarty/.pyenv/versions/3.6.0/lib/python3.6/lib-dynload
/home/jnmclarty/.pyenv/versions/3.6.0/lib/python3.6/site-packages
python2
python3
python2.7
pyenv local system
pyenv virtualenv 2.7.13 my-virtual-env-2.7.13
pyenv local my-virtual-env-2.7.13
pip install flask
python
>>> import flask
>>> flask.__file__
'/home/jnmclarty/.pyenv/versions/my-virtual-env-2.7.13/lib/python2.7/site-packages/flask/__init__.pyc'
. ~/.use_anaconda3
python
/home/jnmclarty/anaconda3/lib/python35.zip
/home/jnmclarty/anaconda3/lib/python3.5
/home/jnmclarty/anaconda3/lib/python3.5/plat-linux
/home/jnmclarty/anaconda3/lib/python3.5/lib-dynload
/home/jnmclarty/anaconda3/lib/python3.5/site-packages
/home/jnmclarty/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg
/home/jnmclarty/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg
. ~/.use_anaconda3
conda create -n my27 python=2.7
source activate my27
/home/jnmclarty/anaconda3/envs/my27/lib/python27.zip
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/plat-linux2
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/lib-tk
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/lib-old
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/lib-dynload
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/site-packages
/home/jnmclarty/anaconda3/envs/my27/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg
python
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
python3
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
/usr/local/lib/python3.5/dist-packages
/usr/lib/python3/dist-packages