This question already has answers here:
"SSLError: The read operation timed out" when using pip
(2 answers)
Closed 6 years ago.
I have researched a lot for this error but could not find one which could solve my problem
I am install Django 1.9 on Ubuntu 14.04 using pip in Virtual Environment. My python version is 3.4.0 . I have already tried a lot of solutions like using and not using sudo and
python -m pip install -U --force-reinstall pip
but nothing worked for me.
Here's my error.
(myvenv)surpsi#Lord-of-Codes:~$ sudo pip install django
[sudo] password for surpsi:
Downloading/unpacking django
Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 1.4MB 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/surpsi/.pip/pip.log
pip --default-timeout=100 install django
you can override the default timeout, try with the command above. Credits go to https://stackoverflow.com/a/19334551/903790
Related
I am having some difficulties in installing TensorFlow on my computer.
My OS: Windows 8
My Python version: 3.7 (64-bit)
I used pip install Tensorflow
https://www.tensorflow.org/install/pip
Should I copy its commands to cmd? Or I should change some details of them accordingly?
For example:
I tried running code:
pip3 install -U pip virtualenv
Here is what I get:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\A>virtualenv --system-site-packages -p python3 ./venv
The path python3 (from --python=python3) does not exist
What does it mean by "the path does not exist"? I tried changing "python3 ." to "python3.7 .", but it doesn't work out.
Even tho the first command didn't work out, it seems the pip, python, and virtualenv are installed on my PC.
Here is the issue I have when I try to download Tensorflow:
I tried running code:
pip install --upgrade tensorflow
This is the error:
C:\Users\A>.\venv\Scripts\activate
The system cannot find the path specified.
C:\Users\A>pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\a\appdata\local\programs\python\
python37\lib\site-packages (20.0.2)
C:\Users\A>
C:\Users\A>pip list # show packages installed within the virtual environment
Package Version
---------- -------
pip 20.0.2
setuptools 45.1.0
virtualenv 16.7.9
wheel 0.34.2
C:\Users\A>pip install --upgrade tensorflow
Collecting tensorflow
Downloading tensorflow-2.1.0-cp37-cp37m-win_amd64.whl (355.8 MB)
| | 788 kB 3.2 kB/s eta 1 day, 6:26:40ERROR:
Exception:
Traceback (most recent call last):
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\urllib3\response.py", line 425, in _error_catcher
yield
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\urllib3\response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\a\appdata\local\programs\python\python37\lib\http\client.py", l
ine 457, in read
n = self.readinto(b)
File "c:\users\a\appdata\local\programs\python\python37\lib\http\client.py", l
ine 501, in readinto
n = self.fp.readinto(b)
File "c:\users\a\appdata\local\programs\python\python37\lib\socket.py", line 5
89, in readinto
return self._sock.recv_into(b)
File "c:\users\a\appdata\local\programs\python\python37\lib\ssl.py", line 1071
, in recv_into
return self.read(nbytes, buffer)
File "c:\users\a\appdata\local\programs\python\python37\lib\ssl.py", line 929,
in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\operations\prepare.py", line 482, in prepare_linked_requirement
hashes=hashes,
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\operations\prepare.py", line 287, in unpack_url
hashes=hashes,
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\operations\prepare.py", line 159, in unpack_http_url
link, downloader, temp_dir.path, hashes
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\operations\prepare.py", line 303, in _download_http_url
for chunk in download.chunks:
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\utils\ui.py", line 160, in iter
for x in it:
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_internal\network\utils.py", line 39, in response_chunks
decode_content=False,
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\urllib3\response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\urllib3\response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\a\appdata\local\programs\python\python37\lib\contextlib.py", li
ne 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\a\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files
.pythonhosted.org', port=443): Read timed out.
C:\Users\A>https://github.com/tensorflow/tensorflow/issues/5949
How can I install Tensorflow? Thank you!
Update 1:
When I change 'python 3' to 'python', and 'pip3' to 'pip', the first few command lines work out.
However, I still can't download Tensorflow.
A bit more has been downloaded this time:
(venv) C:\Users\A> pip install --upgrade tensorflow
Collecting tensorflow
Downloading tensorflow-2.1.0-cp37-cp37m-win_amd64.whl (355.8 MB)
|█ | 8.4 MB 10.0 kB/s eta 9:40:28ERROR: Exce
ption:
Traceback (most recent call last):
File "c:\users\a\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line
425, in _error_catcher
yield
File "c:\users\a\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line
507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\a\venv\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.p
y", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\http\client.py", l
ine 457, in read
n = self.readinto(b)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\http\client.py", l
ine 501, in readinto
n = self.fp.readinto(b)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\socket.py", line 5
89, in readinto
return self._sock.recv_into(b)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\ssl.py", line 1071
, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\ssl.py", line 929,
in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\a\venv\lib\site-packages\pip\_internal\cli\base_command.py", li
ne 186, in _main
status = self.run(options, args)
File "c:\users\a\venv\lib\site-packages\pip\_internal\commands\install.py", li
ne 331, in run
resolver.resolve(requirement_set)
File "c:\users\a\venv\lib\site-packages\pip\_internal\legacy_resolve.py", line
177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\a\venv\lib\site-packages\pip\_internal\legacy_resolve.py", line
333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\a\venv\lib\site-packages\pip\_internal\legacy_resolve.py", line
282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\a\venv\lib\site-packages\pip\_internal\operations\prepare.py",
line 482, in prepare_linked_requirement
hashes=hashes,
File "c:\users\a\venv\lib\site-packages\pip\_internal\operations\prepare.py",
line 287, in unpack_url
hashes=hashes,
File "c:\users\a\venv\lib\site-packages\pip\_internal\operations\prepare.py",
line 159, in unpack_http_url
link, downloader, temp_dir.path, hashes
File "c:\users\a\venv\lib\site-packages\pip\_internal\operations\prepare.py",
line 303, in _download_http_url
for chunk in download.chunks:
File "c:\users\a\venv\lib\site-packages\pip\_internal\utils\ui.py", line 160,
in iter
for x in it:
File "c:\users\a\venv\lib\site-packages\pip\_internal\network\utils.py", line
39, in response_chunks
decode_content=False,
File "c:\users\a\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line
564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\a\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line
529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\A\AppData\Local\Programs\Python\Python37\Lib\contextlib.py", li
ne 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\a\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line
430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files
.pythonhosted.org', port=443): Read timed out.
(venv) C:\Users\A>
Update 2:
I used the following command line:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
Much more was downloaded.
Here is the new error:
ERROR: Could not find a version that satisfies the requirement tensorboard<2.2.0
,>=2.1.0 (from tensorflow) (from versions: 1.6.0rc0, 1.6.0, 1.7.0, 1.8.0, 1.9.0,
1.10.0, 1.11.0, 1.12.0, 1.12.1, 1.12.2, 1.13.0, 1.13.1, 1.14.0, 1.15.0, 2.0.0,
2.0.1, 2.0.2)
ERROR: No matching distribution found for tensorboard<2.2.0,>=2.1.0 (from tensor
flow)
C:\Users\A>
Do I need a different version of Tensorflow?
Use below commands to install TensorFlow inside virtual environment.
1) upgrade pip3:
python3 -m pip install --upgrade pip
2) Install virtual env
pip3 install virtualenv
3) You can then create a virtualenv using the full path of python3 like this:
virtualenv -p /home/example_username/opt/python-3.6.2/bin/python3 venv
4) Activate virtual env
source venv/bin/activate
5) install tensorflow
pip3 install tensorflow
please note this error message.
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files
.pythonhosted.org', port=443): Read timed out.
It seems that you can't connect to files.pythonhosted.org. You can visit this url: https://pypi.org/project/tensorflow/#files to down tensorflow-2.1.0-cp37-cp37m-win_amd64.whl first. And then use pip install <name>.whl to install it.
More:
If you are in China, you can use bellow command to install tensorflow from tsinghua University.
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
I'm trying to install tensorflow-gpu
using python3.6 and anaconda 3
I'm following the instalation steps in the following link https://www.tensorflow.org/install/install_windows
1- I have Createed a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow python=3.6
2- then Activated the conda environment by issuing the following command:
C:> activate tensorflow
(tensorflow)C:>
but comming for the final step to install TensorFlow inside my conda environment. using that command pip install --ignore-installed --upgrade tensorflow-gpu
I got that error
(C:\Users\Chaymae\Anaconda3) C:\WINDOWS\system32>activate tensorflow
(tensorflow) C:\WINDOWS\system32>pip install --ignore-installed --upgrade tensorflow-gpu
Collecting tensorflow-gpu
Downloading tensorflow_gpu-1.4.0-cp36-cp36m-win_amd64.whl (67.6MB)
25% |████████ | 16.9MB 5.3kB/s eta 2:38:22Exception:
Traceback (most recent call last):
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 302, in _error_catcher
yield
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 560, in resp_read
decode_content=False):
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 307, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
Well after that I have tried to install the cpu version I got the same error.
If anyone could help I would be thankful, I really want to start learning tensorflow.
Had the same problem with timeout.
Did pip --default-timeout=300 install tensorflow but still having the same problem.
Search the web for more info and I manage to install TF using pip.
This was what I did to overcome the issue:
Run this line first
conda config --set ssl_verify no
Follow by this(you can change the timeout or just try it without the timeout)
pip --default-timeout=300 install tensorflow
It was only the problem of unstable Internet connection, it's installed now and running very well
It is indeed a problem of unstable internet connection.
you can set the default-timeout to say 60 (sec). e.g. pip --default-timeout=60 install tensorflow
I am trying to install spacy. I am on CentOS Linux
!pip install -U spacy
in a jupyter notebook and everything was working fine. During the installation, I realized I intended to include the --user command since I intended to install for my user only, so I hit ctrl-c. At this point the installation is incomplete.
Trying to install the package again with pip is now giving me an error, regardless of whether I include the --user flag. I think the error, below, is related to the incomplete build. Does anyone know how to fix this?
Collecting spacy
Exception:
Traceback (most recent call last):
File "/opt/anaconda2/lib/python2.7/site-packages/pip/basecommand.py", line
215, in main
status = self.run(options, args)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/commands/install.py",
line 335, in run
wb.build(autobuilding=True)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/wheel.py", line 749, in
build
self.requirement_set.prepare_files(self.finder)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
620, in _prepare_file
session=self.session, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 809,
in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 715,
in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 811, in _
RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file`
Thanks everyone. A solution that worked for me was to go to $HOME/.cache/pip and delete the contents of http/ and wheels/
When installing tensorflow-gpu 1.4.0 using pip in Windows 10 (Python 3.5), I get the following strange error. Very interestingly, each time I run
pip.exe install tensorflow-gpu
it downloads a small but seemingly random part of the package, then raises the following exception:
(C:\Users\carth\Anaconda3\envs\py35) E:\Data\ownCloud\Work\CoronaryML>pip.exe install tensorflow-gpu
Collecting tensorflow-gpu
Downloading tensorflow_gpu-1.4.0-cp35-cp35m-win_amd64.whl (67.6MB)
Exception: | 266kB 797kB/s eta 0:01:25
Traceback (most recent call last):
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\utils\ui.py", line 141, in iter
self.next(n)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\progress\__init__.py", line 73, in next
self.update()
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\progress\bar.py", line 41, in update
self.writeln(line)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\progress\helpers.py", line 67, in writeln
self.clearln()
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\progress\helpers.py", line 63, in clearln
print('\r\x1b[K', end='', file=self.file)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 166, in write_and_convert
self.write_plain_text(text, cursor, start)
File "C:\Users\carth\Anaconda3\envs\py35\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
OSError: raw write() returned invalid length 2 (should have been between 0 and 1)
I tried turning off my antivirus, in case that was killing it, but it didn't help.
In the end, I managed to install it by downloading the .whl from PyPI manually, then running pip.exe install path/to/.whl, but I'd like to understand what caused the original failure.
Any ideas?
This issue has been documented here, you can update to python 3.6 or install and enable the win_unicode_console package to solve it
https://bugs.python.org/issue32245
Switch to cmd with administrator rights to run the command:
pip3 install --ignore-installed --upgrade tensorflow-gpu -i https://pypi.tuna.
tsinghua.edu.cn/simple
I am trying to deploy python flask application using apache2 and mod-wsgi.
I am following this link.
While installing mog-wsgi using the command sudo apt-get install libapache2-mod-wsgi ,I see these lines at the end
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
Is this a smooth installation?
Also, in step 1 of the link when I tried to create a virtual environment using the command
sudo virtualenv venv
This gives me error sudo: virtualenv: command not found
So, I tried to install virtualenv using sudo pip install virtualenv, I am getting this huge error in red(exception).
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
What could be the problem?
Please use apt-get install virtualenv or apt-get install python-virtualenv (depending on your OS version) instead of polluting the system with packages installed by sudo pip install.