-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Maplotlib fails to install from source #3650
Comments
Hi @nithinivi thank you very much for reporting this. Could you please confirm that a "non-editable" installation works without any problem? (i.e. following the same steps you described in the "How to reproduce" section from scratch but replacing the installation command with |
@abravalheri Hi thanks for the response. On trying "non-editable" I'm getting the same I am getting the following error lto1: internal compiler error: compressed stream: data error
0x7ffa51786082 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
compilation terminated.
/home/nithin/miniconda3/envs/mpl-dev/compiler_compat/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
error: command '/usr/bin/g++' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for matplotlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/nithin/miniconda3/envs/mpl-dev/bin/python /home/nithin/miniconda3/envs/mpl-dev/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp53oeeng0
cwd: /home/nithin/learn/matplotlib
Building wheel for matplotlib (pyproject.toml) ... error
ERROR: Failed building wheel for matplotlib
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects
|
Thank you very much @nithinivi. Since the non-editable install and the legacy install all fail to build with the same problem, I think we can rule out the hypothesis that this is caused by the PEP 660 implementation in setuptools. I tried to reproduce the error with the following procedure: git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
conda env create -f environment.yml
conda activate mpl-dev
python -m pip -v install . In my dev machine with Ubuntu 20.04.5 LTS and Python 3.10.6 (created by conda), I can install the project from the source code without experiencing the error you describe: Successfully installed matplotlib-3.7.0.dev508+g5c58816e41 I can also install it using the editable mode: python -m pip -v install -e . and everything still works fine: Successfully installed matplotlib-3.7.0.dev508+g5c58816e41 Next, I tried to run the procedure in a container:
Successfully installed matplotlib-3.7.0.dev508+g5c58816e41 I was also able to do an editable install inside the same container: python -m pip -v install -e . Successfully installed matplotlib-3.7.0.dev508+g5c58816e41 Is there any chance you can share with us a reproduceable isolated environment that results in the error you are seeing (ideally in a container)? I am starting to suspect that this problem might be dependent on the dev environment... |
I am renaming the issue to reflect the latest findings. |
@abravalheri I just followed your procedure exactly, and I'm failing to build matplotlib: git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
conda env create -f environment.yml
conda activate mpl-dev
python -m pip -v install . (actually I already had an up-to-date clone so I skipped the Here is the tail end of my failure with non-editable install (as above):
Here is the failure with editable install
Here is the tail end of the output/error if I use
System info: Ubuntu 22.04.1 LTS (jammy) All fail on the same g++ line (something relating to freetype). I'll poke around and see what I can discover but meanwhile LMK if there's additional info that would be helpful or things you want me to try |
A thing that jumps out to me is that these errors are happening when a mix of the system and conda compiler tool chains:
|
I fixed this by |
setuptools version
65.5.0
Python version
python 3.10.6
OS
Ubuntu 9.4.0-1ubuntu1~20.04.1
Additional environment information
conda 4.12.0
gcc version 9.4.0
Description
Attempt to build an editable install of project Matplotlib encounters an internal compiler error referencing PEP 660.
While using the suggested workaround with environment variable
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
subprocess-exited-with-error is encountered.References to similar issues:
#3644 SQLAlchemy editable install failure references setuptools PEP 660
#3606 [Question] Editable install fails after introducing pyproject.toml
#3607 [BUG] If you are seeing this error, please report to
#3597 Struggling with fairseq installation
Expected behavior
The expectation is no error and a successfully built editable install.
How to Reproduce
Output
when using the suggested workaround with environment variable
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
.The text was updated successfully, but these errors were encountered: