I've created a Python 3.6 environment in my WSL Ubuntu 22.04 operating system using virtualenv -p python3.6 <my_env>
. I need to download some packages, particularly matplotlib, but I'm having some problems.
When I run pip install matplotlib
from terminal, it returns me ERROR: Command errored out with exit status 1, as it fails to build wheel for matplotlib, kiwisolver and pillow.
I can't upgrade the Python version.
I don't know what to do, I've tried everything I found online, but it's not working.
Output
Building wheel for matplotlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/andrea/Andrea/env/pyaneti_env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-e23pjohb
cwd: /tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/
Complete output (1714 lines):
[...]
AttributeError: install_layout
ERROR: Failed building wheel for matplotlib
Analogue results for kiwisolver and pillow
I've created a Python 3.6 environment in my WSL Ubuntu 22.04 operating system using virtualenv -p python3.6 <my_env>
. I need to download some packages, particularly matplotlib, but I'm having some problems.
When I run pip install matplotlib
from terminal, it returns me ERROR: Command errored out with exit status 1, as it fails to build wheel for matplotlib, kiwisolver and pillow.
I can't upgrade the Python version.
I don't know what to do, I've tried everything I found online, but it's not working.
Output
Building wheel for matplotlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/andrea/Andrea/env/pyaneti_env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-e23pjohb
cwd: /tmp/pip-install-3byxbnl0/matplotlib_5a7e3488d8ed4fa586ccee5566cd5543/
Complete output (1714 lines):
[...]
AttributeError: install_layout
ERROR: Failed building wheel for matplotlib
Analogue results for kiwisolver and pillow
Share Improve this question edited Mar 18 at 10:16 Matt Pitkin 6,6451 gold badge25 silver badges45 bronze badges asked Mar 17 at 13:36 Andrea BaroneAndrea Barone 296 bronze badges 7 | Show 2 more comments2 Answers
Reset to default 0One possible cause is an old setuptools version. Try this:
python3.6 -m pip install -U setuptools
Then retry installing matplotlib.
Here I am answering my own question.
After trying everything you and the internet suggested, I gave up on using virtualenv
.
As Matt suggested in the comments, I downloaded miniconda
and created an environment there. I was able to download all the packages and the code is running nicely.
Thanks for your help.
pip install matplotlib==VERSION_NUM
– UnsanitizedInput Commented Mar 17 at 13:44sudo apt update
(I'm still not used to Ubuntu). I don't need any specific version, but I've already tried installing 3.2.1 and 3.3.4, and the results are the same. – Andrea Barone Commented Mar 17 at 13:53