Stay Hungry, Stay Foolish

Ubuntu安装最新的Python 3.6版本

Python 5247℃ 0评论

Ubuntu16.04版本最新的Python 3.x版本3.5 。

可以从源代码执行安装最新稳定版本3.6。

要安装Python 3.6 ,请运行以下命令:

# wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
# tar -xvf Python-3.6.2.tar.xz
# cd Python-3.6.2
# ./configure
# make
# make install
如果出现错误:
can’t decompress data; zlib not available
说明缺少依赖:zlib。
# 安装依赖zlib、zlib-devel
# 在ubuntu里,zlib叫zlib1g,相应的zlib-devel叫zlib1g-dev
$ sudo apt-get install zlib1g
$ sudo apt-get install zlib1g-dev

当安装完成后,使用它来验证主二进制文件的位置:

# which python3
# python3 -V

如果不是最新的3.6,重启系统。

在Linux中检查Python 3版本

# python3

要退出Python提示符,只需键入。

quit()
or
exit()
并按Enter键。

恭喜!Python 3.6现在安装在您的系统上。

执行pip install时出现:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

需要安装:

$ sudo apt-get install openssl
$ sudo apt-get install libssl-dev

重新

$ sudo  ./configure
$ sudo make && make install
喜欢 (3)
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦


Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in C:\inetpub\wordpress\wp-content\themes\XHBlog\comments.php on line 17
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址