安装pythod-virtualenv

Centos6.5环境安装pythod-virtualenv时,yum安装失败:

1
$ yum install python-virtualenv

错误提示:

1
2
3
4
5
6
7
8
9
$ yum install python-virtualenv
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.yun-idc.com
* updates: mirrors.btte.net
Setting up Install Process
No package python-virtualenv available.
Error: Nothing to do

没有找到此问题的具体原因和解决方案,所以只能更换virtualenv的安装方式。

另一种安装方式:

1
2
$ yum install python-setuptools
$ easy_install virtualenv

报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@server45 ~]# pip install https://github.com/pypa/virtualenv/tarball/develop
Collecting https://github.com/pypa/virtualenv/tarball/develop
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/tarball/develop
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/tarball/develop
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/tarball/develop
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/legacy.tar.gz/develop
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/legacy.tar.gz/develop
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /pypa/virtualenv/legacy.tar.gz/develop
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading https://github.com/pypa/virtualenv/tarball/develop
- 1.7MB 25.2MB/s
Installing collected packages: virtualenv
Running setup.py install for virtualenv
Successfully installed virtualenv-13.2.0.dev0
[root@server45 ~]# pip install virtualenv

1
2
3
4
5
r service not known'))': /simple/setuptools/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/setuptools/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/setuptools/
/root/.local/share/letsencrypt/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

http://stackoverflow.com/questions/29155407/connection-to-pypi-python-org-timed-out

https://github.com/pypa/pip/issues/2269