您的位置:首页 > 编程语言 > Python开发

python 3.5.0 installation fails on ubuntu 14.04

2017-02-02 16:16 471 查看
今天安装好pyenv的目的是为了安装3.5.1和便于管理python库,但是遇到了如下问题:

pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
1->        https://yyuu.github.io/pythons/584e3d5a02692ca52fce505e68ecd77248a6f2c99adf9db144a39087336b0fe0 Installing Python-3.5.0...
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem. https://github.com/yyuu/pyenv/wiki/Common-build-problems 
BUILD FAILED (Ubuntu 14.04 using python-build 20151105-4-g9ca7de5)


查阅半天终于在stackoverflow上找到解决方式。

Ref: 
https://stackoverflow.com/questions/37227854/pyenv-build-failed-ubuntu-15-04-using-python-build-20160509/37229034#37229034 https://github.com/yyuu/pyenv/issues/483
0down vote
To install python by using
pyenv
, the command
pyenv install -v 2.7.11
could show more message than
pyenv install 2.7.11
. So it will be easy for me to locate the error. This time I got

curl: (77) error setting certificate verify locations: CAfile:
/etc/pki/tls/certs/ca-bundle.crt
CApath: none

This problem has already been solved in
curl: (77) error

# sudo apt-get install ca-certificates

The issue was that curl expected the certificate to be at the path
/etc/pki/tls/certs/ca-bundle.crt
but could not find it because it was at the path
/etc/ssl/certs/ca-certificates.crt
.

Copying my certificate to the expected destination by running

sudo cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt

worked for me. You will need to create folders for the target destination if they do not exist by running

sudo mkdir -p /etc/pki/tls/certs

If needed, modify the above command to make the destination file name match the path expected by curl, i.e. replace
/etc/pki/tls/certs/ca-bundle.crt
with the path following "CAfile:" in your error message.

同时千万记得,安装完后要进行数据库更新:

pyenv rehash
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: