sudo apt-get update
sudo apt-get install curl git-core
curl -L https://raw.github.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
vim ~/.bashrc
# pyenv
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
source ~/.bashrc
或者
export PATH="/home/hgw/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
sudo apt-get install libbz2-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libssl-dev
sudo apt-get install build-essential
sudo apt-get install -y make cmake
sudo apt-get install -y zlib1g-dev libreadline-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
或
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
sudo apt install libedit-dev
pyenv install --list
pyenv install 2.7.15
pyenv virtualenv 2.7.15 env2715
pyenv activate env2715
pip install tensorflow-gpu==1.4 # gpu
# pip install tensorflow==1.4 # cpu
pip install keras==2.13
pyenv global 2.7.15
pyenv global system
pyenv uninstall 2.7.15
rm -rf /home/hgw/.pyenv/versions/2.7.15/envs/env2715