zoukankan      html  css  js  c++  java
  • CentOS 6.5 pyenv环境配置

    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
  • 相关阅读:
    [洛谷P3403] 跳楼机
    [hdu4630] No Pain No Game
    django-rest-swagger 使用【转】
    Django REST framework入门 (转自中文文档)
    model补充验证钩子函数 性能优化等
    python新动态执行 文件头标识 禁止断言
    Dmango cxrf 自定义分页 缓存 session 序列化 信号量 知识点
    pytho 解析fiddler 导出的har文件代码,自动录入api
    django model 操作总结
    django FBV +CBV 视图处理方式总结
  • 原文地址:https://www.cnblogs.com/orcsir/p/8467978.html
Copyright © 2011-2022 走看看