virtualenv安装SSLError:读取操作超时

时间:2016-03-27 09:22:06

标签: python apache2 pip virtualenv

我正在尝试使用apache2和mod-wsgi部署python flask应用程序。 我正在关注this链接。

使用命令sudo apt-get install libapache2-mod-wsgi安装mog-wsgi时,我在最后看到这些行

apache2_invoke: Enable module wsgi
Action 'configtest' failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2

这是一个顺利安装吗? 此外,在我尝试使用命令

创建虚拟环境时的链接的第1步
sudo virtualenv venv

这给了我错误sudo: virtualenv: command not found

所以,我尝试使用sudo pip install virtualenv安装virtualenv,我收到红色的这个巨大错误(例外)。

Downloading/unpacking virtualenv
Downloading virtualenv-15.0.1-py2.py3-none-any.whl (1.8MB): 733kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files
do_download,
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
self.session,
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url
for chunk in resp_read(4096):
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read
chunk_size, decode_content=False):
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read
data = self._fp.read(amt)
File "/usr/lib/python2.7/httplib.py", line 573, in read
s = self.fp.read(amt)
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: The read operation timed out

Storing debug log for failure in /home/myname/.pip/pip.log

可能是什么问题?

1 个答案:

答案 0 :(得分:1)

请使用apt-get install virtualenvapt-get install python-virtualenv(取决于您的操作系统版本),而不是使用sudo pip install安装的软件包污染系统。