美文网首页
[转载]ubuntu16.04安装python3.7

[转载]ubuntu16.04安装python3.7

作者: 廷裕同学 | 来源:发表于2019-06-12 14:50 被阅读0次

    1.安装依赖包

    sudo apt-get update
    sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
    sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
    sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
    sudo apt-get install libssl-dev openssl
    sudo apt-get install libffi-dev
    
    1. 安装pyenv
     git clone git://github.com/yyuu/pyenv.git ~/.pyenv
     echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
     echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
     echo 'eval "$(pyenv init -)"' >> ~/.bashrc
     exec $SHELL -l
    
    1. 安装 python3.7.0
    pyenv install 3.7.0 -v
    

    3.1安装完成之后,需要使用如下命令对数据库进行更新:

    pyenv rehash
    

    3.2查看已经安装的python版本:

    pyenv versions
    * system (set by /root/.pyenv/version)
    3.7.0
    

    4.设置全局python版本

    pyenv global 3.7.0 
    

    安装完python3.7安装在/root/.pyenv/shims/python3.7

    转自:https://www.cnblogs.com/bkylkh/p/9412906.html

    相关文章

      网友评论

          本文标题:[转载]ubuntu16.04安装python3.7

          本文链接:https://www.haomeiwen.com/subject/zhrlfctx.html