ubuntu16.04安裝python3.7
阿新 • • 發佈:2018-08-03
glob bin del zlib 設置 完成 sql 安裝 libffi
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
2. 安裝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
3. 安裝 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
ubuntu16.04安裝python3.7