Cannot create Virtualenv in Python - 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.

Related

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?

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

FileNotFoundError while installing pocketsphinx via anaconda

C:\Windows\System32>"C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python3
6-32\python.exe" -m pip install pocketsphinx-0.1.3-cp36-cp36m-win32.whl
Requirement 'pocketsphinx-0.1.3-cp36-cp36m-win32.whl' looks like a filename, but
the file does not exist
Processing c:\windows\system32\pocketsphinx-0.1.3-cp36-cp36m-win32.whl
Exception:
Traceback (most recent call last):
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\download.py", line 715, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\utils\__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "C:\Users\Dinesh Kumar\AppData\Local\Programs\Python\Python36-32\lib\site
-packages\pip\utils\__init__.py", line 482, in unzip_file
zipfp = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Windows\\System32\\
pocketsphinx-0.1.3-cp36-cp36m-win32.whl'
This was the error when I typed those 2 commands. I have the file in the right directory but it is showing like file does not exist.
I have downloaded the right file according to the following commands.
"C:\Users\krush\Anaconda3\python.exe" --version
"C:\Users\krush\Anaconda3\python.exe" -c "importstruct;print(struct.calcsize('P') * 8)"
download it from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx
then install the package by following command:
python -m pip install pocketsphinx-0.1.3-cp36-cp36m-win32.whl

Unable to upgrade Scipy using PIP

I try to upgrade Scipy using PIP on Ubuntu 16.04 but always receive this error. I'm not sure what is going on. The progress reaches 99% and then stops, and spits out this error.
I've tried upgrading pip but the same error still occurs.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 310, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 750, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 587, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url
hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 595, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 563, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 552, in resp_read
decode_content=False):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 353, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 310, in read
data = self._fp.read(amt)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
).encode("utf8"),
MemoryError
Try to disable the cache during install using
pip install --no-cache-dir packageName
where packageName is scipy in this case
The last line says "MemoryError"
Are you using a virtual environment?
If so, the environment probably requires more memory to be allocated to it.
Go to Player > Manage > Virtual Machine Settings
Here, drag the slider to choose a higher value of memory to be allocated.
Restart the virtual environment for the changes to take place.
I hope this helps!

Encoding error when attempt to install matplotlib on ubuntu

I'm attempting to install matplotlib in a python2 virtualenv in Ubuntu 14.04, and am running into the following error:
../virtualenv/bin/pip install matplotlib
Traceback (most recent call last):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/commands/install.py", line 305, in run
wb.build(autobuilding=True)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/wheel.py", line 705, in build
self.requirement_set.prepare_files(self.finder)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 491, in _prepare_file
session=self.session)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 825, in unpack_url
session,
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 886, in _download_http_url
_download_url(resp, link, content_file)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/utils/ui.py", line 133, in iter
for x in it:
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/download.py", line 586, in resp_read
decode_content=False):
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 307, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 243, in read
data = self._fp.read(amt)
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 224, in cache_response
self.serializer.dumps(request, response, body=body),
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 49, in dumps
"body": _b64_encode_bytes(body),
File "/home/me/sites/dashboard.mysite.com/virtualenv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 12, in _b64_encode_bytes
return base64.b64encode(b).decode("ascii")
MemoryError
Any thoughts about what might be going on and why I am getting a Memory Error?
This appears to be the MemoryError while trying to install a large package (matplotlib) in a low memory environment. It appears that the cause is the caching mechanism, as disabling the cache fixes the issue.
Try this:
pip install --no-cache-dir matplotlib

Categories