使用pythonz创建新的Python

发布时间:2019-10-11 09:02:11编辑:auto阅读(2206)

    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

关键字