使用pythonz建立新的Python環境(3.6)

PETCoder亞洲善待程式猿組織發表於2019-02-16
echo 下載安裝pythonz
curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash
echo 新增到bashrc
echo "[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc" >> ~/.bashrc
echo 重啟bash
bash
echo 安裝一些必要的環境
yum groupinstall "Development tools"  
yum install zlib-devel bzip2-devel openssl-devel readline-devel ncurses-devel sqlite-devel gdbm-devel db4-devel expat-devel libpcap-devel xz-devel pcre-devel
echo 安裝目標版本
pythonz install 3.6.0
echo 建立虛擬環境
echo 注意3.6是venv,之前是pyvenv
/usr/local/pythonz/pythons/CPython-3.6.0/bin/python3.6 -m venv ~/venv/3.6
echo 啟用虛擬環境
source ~/venv/3.6/bin/activate

相關文章