码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 6.5 pyenv环境配置

时间:2018-02-25 00:03:29      阅读:1280      评论:0      收藏:0      [点我收藏+]

标签:error   back   current   while   pyenv   span   exp   ref   zip   

Pyenv安装步骤:

Step 1.安装git及其依赖包。yum源为本地系统光盘。

[root@localhost ~]# yum -y install git
[root@localhost ~]# yum -y install gcc make patch gdbm-devel openssl-devel sqlite-devel zlib-devel bzip2-devel readline-devel

Step 2.添加python用户

[root@localhost ~]# useradd python
[root@localhost ~]# echo "p@SSw0rd" | passwd --stdin python

Step 3.使用python用户登陆系统,执行安装命令

[python@localhost ~]$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash 

笔者在安装过程中出现如下错误:

[python@localhost ~]$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
104 2099 104 2099 0 0 319 0 0:00:06 0:00:06 --:--:-- 5437
Initialized empty Git repository in /home/python/.pyenv/.git/
error: while accessing https://github.com/yyuu/pyenv.git/info/refs

解决方法:

Step 1.开启GIT_CURL_VERBOSE,获取更多错误提示

[python@localhost ~]$ export GIT_CURL_VERBOSE=1

Step 2.重新执行安装命令,定位出错原因

[python@localhost ~]$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
<------此处忽略若干输出------>
* NSS error -12286
* Expire cleared
* Closing connection #0
error: while accessing https://github.com/yyuu/pyenv.git/info/refs

fatal: HTTP request failed
注:问题出在NSS的版本过低。

Step 3.配置阿里源,更新nss

[root@localhost ~]# wget -O /etc/yum.repos.d/Alibaba.repo http://mirrors.aliyun.com/repo/Centos-6.repo
[root@localhost ~]# yum update nss

Setp 4.再次执行安装命令即可。

[python@localhost ~]$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

 

CentOS 6.5 pyenv环境配置

标签:error   back   current   while   pyenv   span   exp   ref   zip   

原文地址:https://www.cnblogs.com/orcsir/p/8467978.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!