Python Forum

Full Version: Error when installing Seaborn package using pip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been using pip to install other packages and it works perfectly (ex. for numpy). However when downloading/installing seaborn I get an
unexpected error. I'm installing on a Raspberry Pi 3 running Raspbian GNU/Linux 9.4 (stretch), and am using Python 3.5.3

Pretty straightforward code:

pip install seaborn
Which outputs this:

Output:
Collecting seaborn Using cached https://files.pythonhosted.org/packages/10/01/dd1c7838cde3b69b247aaeb61016e238cafd8188a276e366d36aa6bcdab4/seaborn-0.8.1.tar.gz Collecting matplotlib (from seaborn) Downloading https://files.pythonhosted.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz (37.3MB) 99% |████████████████████████████████| 37.3MB 2.0MB/s eta 0:00:01
Which is immediately followed by this error:

Error:
Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run wb.build(autobuilding=True) File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 620, in _prepare_file session=self.session, hashes=hashes) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 821, in unpack_url hashes=hashes File "/usr/lib/python2.7/dist-packages/pip/download.py", line 659, in unpack_http_url hashes) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 882, in _download_http_url _download_url(resp, link, content_file, hashes) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 603, in _download_url hashes.check_against_chunks(downloaded_chunks) File "/usr/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks for chunk in chunks: File "/usr/lib/python2.7/dist-packages/pip/download.py", line 571, in written_chunks for chunk in chunks: File "/usr/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter for x in it: File "/usr/lib/python2.7/dist-packages/pip/download.py", line 560, in resp_read decode_content=False): File "/usr/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 "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/response.py", line 380, in read data = self._fp.read(amt) File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/filewrapper.py", line 63, in read self._close() File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/filewrapper.py", line 50, in _close self.__callback(self.__buf.getvalue()) File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 275, in cache_response self.serializer.dumps(request, response, body=body), File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 55, in dumps "body": _b64_encode_bytes(body), File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 12, in _b64_encode_bytes return base64.b64encode(b).decode("ascii") File "/usr/lib/python2.7/base64.py", line 54, in b64encode encoded = binascii.b2a_base64(s)[:-1] MemoryError
Any help would be greatly appreciated. Thank you
looks like it ran out of memory before it could finish.
How much is available?
worked fine for me:
Output:
Larz60p@linux-nnem: ~:$pip install seaborn Collecting seaborn Downloading https://files.pythonhosted.org/packages/10/01/dd1c7838cde3b69b247aaeb61016e238cafd8188a276e366d36aa6bcdab4/seaborn-0.8.1.tar.gz (178kB) 100% |████████████████████████████████| 184kB 9.4MB/s Collecting scipy (from seaborn) Downloading https://files.pythonhosted.org/packages/40/de/0c22c6754370ba6b1fa8e53bd6e514d4a41a181125d405a501c215cbdbd6/scipy-1.1.0-cp37-cp37m-manylinux1_x86_64.whl (31.2MB) 100% |████████████████████████████████| 31.2MB 3.4MB/s Collecting matplotlib (from seaborn) Downloading https://files.pythonhosted.org/packages/da/1d/e6d9af0b5045597869537391f1036ab841c613c3f3e40f16bbc1d75450ee/matplotlib-2.2.2-cp37-cp37m-manylinux1_x86_64.whl (12.6MB) 100% |████████████████████████████████| 12.6MB 6.3MB/s Collecting pandas (from seaborn) Downloading https://files.pythonhosted.org/packages/63/77/27b920abc3eea0bfec9bd027dbdbbc7b5121b80806de20d331452ef23285/pandas-0.23.3-cp37-cp37m-manylinux1_x86_64.whl (8.9MB) 100% |████████████████████████████████| 8.9MB 7.3MB/s Requirement already satisfied: numpy>=1.8.2 in ./.pyenv/versions/3.7.0/lib/python3.7/site-packages (from scipy->seaborn) (1.14.5) Requirement already satisfied: six>=1.10 in ./.pyenv/versions/3.7.0/lib/python3.7/site-packages (from matplotlib->seaborn) (1.11.0) Collecting kiwisolver>=1.0.1 (from matplotlib->seaborn) Downloading https://files.pythonhosted.org/packages/5c/7e/d6cae2f241ba474a2665f24b480bf4e247036d63939dda2bbc4d2ee5069d/kiwisolver-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (89kB) 100% |████████████████████████████████| 92kB 10.7MB/s Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib->seaborn) Downloading https://files.pythonhosted.org/packages/6a/8a/718fd7d3458f9fab8e67186b00abdd345b639976bc7fb3ae722e1b026a50/pyparsing-2.2.0-py2.py3-none-any.whl (56kB) 100% |████████████████████████████████| 61kB 16.7MB/s Collecting python-dateutil>=2.1 (from matplotlib->seaborn) Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB) 100% |████████████████████████████████| 215kB 11.5MB/s Collecting pytz (from matplotlib->seaborn) Downloading https://files.pythonhosted.org/packages/30/4e/27c34b62430286c6d59177a0842ed90dc789ce5d1ed740887653b898779a/pytz-2018.5-py2.py3-none-any.whl (510kB) 100% |████████████████████████████████| 512kB 11.9MB/s Collecting cycler>=0.10 (from matplotlib->seaborn) Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl Requirement already satisfied: setuptools in ./.pyenv/versions/3.7.0/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib->seaborn) (39.0.1) Installing collected packages: scipy, kiwisolver, pyparsing, python-dateutil, pytz, cycler, matplotlib, pandas, seaborn Running setup.py install for seaborn ... done Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-2.2.2 pandas-0.23.3 pyparsing-2.2.0 python-dateutil-2.7.3 pytz-2018.5 scipy-1.1.0 seaborn-0.8.1 Larz60p@linux-nnem: ~:$
I'm not very experienced with deciphering the Linux file system but this is what I found:
df -h
Output:
Filesystem Size Used Avail Use% Mounted on /dev/root 30G 4.8G 24G 18% / devtmpfs 460M 0 460M 0% /dev tmpfs 464M 61M 403M 14% /dev/shm tmpfs 464M 13M 452M 3% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 464M 0 464M 0% /sys/fs/cgroup /dev/mmcblk0p1 43M 22M 21M 52% /boot tmpfs 93M 0 93M 0% /run/user/1000
I'm using a 32GB SD card and haven't installed very much on it, plus I'm able to install other packages without running into memory issues. But I'm also a newbie, so I apologize if I'm overlooking something from the above disk usage info.
try:
df /usr/lib
which is where you are installing