【问题标题】:How to install virtualenv on Centos6?如何在 Centos6 上安装 virtualenv?
【发布时间】:2017-01-27 20:10:11
【问题描述】:

我想在我的工作场所 Centos6 上应用我的 Flask 项目。所以我按照谷歌的指南安装pip、virtualenv和flask,但我无法成功安装pip或virtualenv。

我所做的是这样的:

1) http://sharadchhetri.com/2014/05/30/install-pip-centos-rhel-ubuntu-debian/

#rpm -ivh httplink://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

#yum install -y python-pip
(version 7.1.0-1.el6)

#pip install virtualenv 

这给了

urllib3 将发出 (InsecurePlatformWarning)

2) https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4

#curl httplink://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python2.7 - 

这给了

curl: (77) SSL CA 证书有问题(路径?访问权限?)

3)http://www.ylabs.co.kr/index.php?document_srl=31854&mid=board_dev_python&order_type=asc&sort_index=title

用python2.7

#cd /tmp

#wget --no-check-certificate httplink://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz

#tar -xvf setuptools-1.4.2.tar.gz

#cd setuptools-1.4.2

#python2.7 setup.py install

这给了

Searching for pip
Reading httplink://pypi.python.org/simple/pip/
Download error on httplink://pypi.python.org/simple/pip/: [Errno 0] _ssl.c:343: error:00000000:lib(0):func(0):reason(0) -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading httplink://pypi.python.org/simple/
Download error on httplink://pypi.python.org/simple/: [Errno 0] _ssl.c:343: error:00000000:lib(0):func(0):reason(0) -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')

4) http://novafactory.net/archives/3074

# wget httplink://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py

# python3.4 ez_setup.py

# easy_install-3.4 pip

# pip3.4 install virtualenv

这给了

Downloading/unpacking virtualenv
  Cannot fetch index base URL httplink://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement virtualenv
Cleaning up...
No distributions at all found for virtualenv
Storing debug log for failure in /root/.pip/pip.log

我的系统是 CentOS release 6.8 (Final), python 2.6/2.7/3.4

pip3 -V : 
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)

pip2 -V :
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

【问题讨论】:

  • httplink 是一个有效的协议吗?你应该从这里下载 get-pip.py:bootstrap.pypa.io/get-pip.py - 即wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
  • 你平台的SSL好像很坏
  • 我猜httplink:// 是某种复制粘贴错误?

标签: python flask pip virtualenv centos6


【解决方案1】:

谢谢你的建议

我所做的是不使用 pip,而是只下载 python 模块包。

我去了链接http://pypi.python.org/simple/ 我从上面的错误消息中得到的(我的 3 次试用)

并下载 [package] 我要找的东西

和 tar -xvf [包]

cd [包]

[python 安装安装]

所以我可以在不使用 pip 的情况下安装 Flask 和 virtualenv

【讨论】:

    猜你喜欢
    • 2020-11-11
    • 1970-01-01
    • 2015-10-13
    • 2013-01-18
    • 2013-09-01
    • 2017-03-10
    • 1970-01-01
    • 2014-11-12
    • 2018-10-03
    相关资源
    最近更新 更多