windows下一般常用Conda管理虚环境,简单方便。偶然在Ubuntu部署环境,感觉Anaconda太过臃肿,后来发现pyenv用起来也很方便,于是简要摘记。
1、安装依赖及一些工具包
sudo apt-get install -y git
sudo apt-get install -y build-essential libbz2-dev libssl-dev libreadline-dev \
libffi-dev libsqlite3-dev tk-dev
# optional scientific package headers (for Numpy, Matplotlib, SciPy, etc.)
sudo apt-get install -y libpng-dev libfreetype6-dev
2、使用pyenv安装脚本进行安装
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
3、增加如下初始化语句到~/.bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
4、重新载入profile
source ~/.bashrc
安装完成。O(∩_∩)O~