Having problems dockerizing my django project - python

I am following along in the Django for Professionals book and I am stuck at the first chapter where you create a django project and app
using pipenv and then Dockerizing it
when running docker build . I get the following error
=> ERROR [4/5] RUN pip install pipenv && pipenv install --system
I ignored that, made a docker-compose.yml file
and ran docker-compose build
and got this error:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
yield
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/usr/local/lib/python3.8/http/client.py", line 458, in read
n = self.readinto(b)
File "/usr/local/lib/python3.8/http/client.py", line 502, in readinto
n = self.fp.readinto(b)
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.8/ssl.py", line 1099, 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 "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 224, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 320, in run
requirement_set = resolver.resolve(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 445, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 339, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 207, in _attempt_to_pin_criterion
criteria = self._get_criteria_to_update(candidate)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 198, in _get_criteria_to_update
for r in self._p.get_dependencies(candidate):
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 100, in get_dependencies
return [
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 100, in <listcomp>
return [
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 252, in iter_dependencies
requires = self.dist.requires() if with_requires else ()
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 234, in dist
self._prepare()
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 221, in _prepare
dist = self._prepare_distribution()
File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 313, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 503, in _prepare_linked_requirement
local_file = unpack_url(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 253, in unpack_url
file = get_http_url(
File "/usr/local/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 130, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/usr/local/lib/python3.8/site-packages/pip/_internal/network/download.py", line 163, in __call__
for chunk in chunks:
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 168, in iter
for x in it:
File "/usr/local/lib/python3.8/site-packages/pip/_internal/network/utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 443, 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.
WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
ERROR: Service 'web' failed to build : The command '/bin/sh -c pip install pipenv && pipenv install --system' returned a non-zero code: 2
This is my Dockerfile:
FROM python:3.8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system
COPY . /code/
This is my docker-compose.yml file:
version: '3.8'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000

Related

Cant install pip modules

ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\base_command.
py", line 216, in _main
status = self.run(options, args)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\req_command.p
y", line 182, in wrapper
return func(self, options, args)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\commands\install.
py", line 324, in run
requirement_set = resolver.resolve(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\resolution\legacy
\resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 255, in unpack_url
file = get_http_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\operations\prepar
e.py", line 282, in _download_http_url
for chunk in download.chunks:
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\progress_bars
.py", line 172, in iter
self.next(len(x)) # noqa: B305
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 120, in next
self.update()
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\bar.py", l
ine 83, in update
self.writeln(line)
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 100, in writeln
if self.file and self.is_tty():
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_vendor\progress\__init__.p
y", line 112, in is_tty
return self.file.isatty() if self.check_tty else True
File "C:\Users\Lenovo\AppData\Local\Temp\tmpj3_890qp\pip.zip\pip\_internal\cli\progress_bars
.py", line 200, in <lambda>
self.file.isatty = lambda: self.file.wrapped.isatty()
AttributeError: 'NoneType' object has no attribute 'isatty'
WARNING: You are using pip version 20.2; however, version 20.2.2 is available.
You should consider upgrading via the 'C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\
python.exe -m pip install --upgrade pip' command.
Everytime I try to install anything with pip this error tends to show up. I tried to reinstall pip with get-pip.py from https://bootstrap.pypa.io/get-pip.py even for this I get the same error.
I am running python 3.8.5 and pip 20.2.

pip upgrade:" python -m pip install --upgrade" says already up-to-date(18.0), "pip --version" says (10.0.1)

I was trying to install some packages from PyPI through pip in "cmd" on Windows 7 as in:
C:\Users\acer\PycharmProjects\Test\venv\Scripts>pip install (some package)
But installation failed with the following message(directly as received from cmd):
Exception:
Traceback (most recent call last):
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_vendor\urllib3\response.py", line 302, in _error_catcher
yield
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_vendor\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\http\client.
py", line 447, in read
n = self.readinto(b)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\http\client.
py", line 491, in readinto
n = self.fp.readinto(b)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\socket.py",
line 589, in readinto
return self._sock.recv_into(b)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 1049, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", lin
e 908, 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\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\basecommand.py", line 228, in main
status = self.run(options, args)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\commands\install.py", line 291, in run
resolver.resolve(requirement_set)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\resolve.py", line 257, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\resolve.py", line 210, in _get_abstract_dist_for
self.require_hashes
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\operations\prepare.py", line 310, in prepare_linked_require
ment
progress_bar=self.progress_bar
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 837, in unpack_url
progress_bar=progress_bar
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 674, in unpack_http_url
progress_bar)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 898, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 618, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\utils\hashes.py", line 48, in check_against_chunks
for chunk in chunks:
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 586, in written_chunks
for chunk in chunks:
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\utils\ui.py", line 159, in iter
for x in it:
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_internal\download.py", line 575, in resp_read
decode_content=False):
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_vendor\urllib3\response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\pip\_vendor\urllib3\response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37-32\lib\contextlib.p
y", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3
.7.egg\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='files
.pythonhosted.org', port=443): Read timed out.
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I have tried to upgrade pip to version 18.0, so I ran python -m pip install --upgrade on cmd (Windows 7):
C:\Users\acer\PycharmProjects\Test\venv\Scripts>python -m pip install --upgrade pip
And after running it, I typed pip --version to check the version I have now:
C:\Users\acer\PycharmProjects\Test\venv\Scripts>pip --version
But the response was that I have pip version 10.0.1 :
pip 10.0.1 from c:\users\acer\pycharmprojects\test\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
After running the upgrade command again, the response was pip is already up-to-date:
Requirement already up-to-date: pip in c:\users\acer\pycharmprojects\test\venv\lib\site-packages (18.0)
Why is there a difference between the two answers? And how to upgrade pip properly?

Cannot create Virtualenv in Python

I'm struggling with virtualenv in Python.
After virtualenv _env I get:
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/marcin/Documents/Projects/django_tutorial/_env/bin/python2
Also creating executable in /home/marcin/Documents/Projects/django_tutorial/_env/bin/python
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /home/marcin/Documen...ial/_env/bin/python2 - setuptools pkg_resources pip wheel:
Collecting setuptools
Downloading setuptools-38.4.0-py2.py3-none-any.whl (489kB)
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 659, in unpack_http_url
hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 560, in resp_read
decode_content=False):
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 432, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 397, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/home/marcin/Documents/Projects/django_tutorial/_env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 312, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
----------------------------------------
...Installing setuptools, pkg_resources, pip, wheel...done.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 992, in create_environment
download=download,
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 922, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 817, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/marcin/Documen...ial/_env/bin/python2 - setuptools pkg_resources pip wheel failed with error code 2
I've got:
virtualenv 15.1.0
pip 9.0.1
Python 2.7.13
I'm out of ideas. I tried exporting locales, reinstalling pip, setuptools and virtualenv.
Do you have any suggestions? I will be grateful.
If you are in China, you can change your pip source to solve this issue.
mkdir ~/.pip
echo '[global]' > ~/.pip/pip.conf
echo 'index-url = https://pypi.tuna.tsinghua.edu.cn/simple' >> ~/.pip/pip.conf
By using the mirror of Tsinghua University, you might solve your problem.

Install tensorflow via pip but failed just as follows

Traceback (most recent call last):<br>
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main<br>
status = self.run(options, args)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run<br>
wb.build(autobuilding=True)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build<br>
self.requirement_set.prepare_files(self.finder)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))<br>
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 821, in unpack_url
hashes=hashes<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 659, in unpack_http_url
hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks<br>
for chunk in chunks:<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 571, in written_chunks
for chunk in chunks:<br>
File "/usr/local/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter<br>
for x in it:<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 560, in resp_read
decode_content=False):<br>
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream<br>
data = self.read(amt=amt, decode_content=decode_content)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 324, in read<br>
flush_decoder = True<br>
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 246, in _error_catcher<br>
raise ReadTimeoutError(self._pool, None, 'Read timed out.')<br>
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
I solved it by modifying the command like this:
pip --default-timeout=100 install THEPACKAGENAME
You can also try installing using wheel packages.
The Wheel packages depend on the kind of operating system you have, the python version and whether you want to install with CPU/GPU support.
Also upgrade you protobuf before installing Tensorflow.
Please find a list of packages here:
https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package
You can then issue this command :
$ sudo pip install --upgrade <TF wheel package URL> - For Python 2.7
$ sudo pip3 install --upgrade <TF wheel package URL> - For Python 3.x
Tensorflow site has some details on some common installation problems. You can look at those as well, just in case.
https://www.tensorflow.org/install/install_linux#common_installation_problems

Error downloading django

I am trying to install Django and have run into an error. This has been a consistent error for me, something I have not been able to figure out how to solve. I am on a mac.
Installing collected packages: Django
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 646, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 339, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 310, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py", line 71, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/django'
as karthikr said, you need
virtualenv project_env
cd project_env
. bin/activate
sudo pip install Django

Categories