Skip to content

[Bug]: install in development mode fails #30038

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

Open
JosephBARBIERDARNAL opened this issue May 11, 2025 · 9 comments
Open

[Bug]: install in development mode fails #30038

JosephBARBIERDARNAL opened this issue May 11, 2025 · 9 comments

Comments

@JosephBARBIERDARNAL
Copy link
Contributor

JosephBARBIERDARNAL commented May 11, 2025

Bug summary

I'm trying to install matplotlib in development mode for a PR, and I'm using this for installing it in dev mode (from here):

python -m pip install --verbose --no-build-isolation --editable ".[dev]"

I've tried all the basic stuffs (removing/re-creating the venv, etc), but I don't understand the error.

Code for reproduction

Right after I git cloned and cd matplotlib:

python -m venv venv
source venv/bin/activate
pip install -r requirements/dev/dev-requirements.txt
pip install -r requirements/doc/doc-requirements.txt
pip install -r requirements/testing/all.txt
python -m pip install --verbose --no-build-isolation --editable ".[dev]"

Actual outcome

Using pip 22.0.4 from /Users/josephbarbier/Desktop/matplotlib/venv/lib/python3.10/site-packages/pip (python 3.10)
Obtaining file:///Users/josephbarbier/Desktop/matplotlib
Running command Checking if build backend supports build_editable
Checking if build backend supports build_editable ... done
Running command Preparing editable metadata (pyproject.toml)

  • meson setup /Users/josephbarbier/Desktop/matplotlib /Users/josephbarbier/Desktop/matplotlib/build/cp310 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/josephbarbier/Desktop/matplotlib/build/cp310/meson-python-native-file.ini
    The Meson build system
    Version: 1.8.0
    Source dir: /Users/josephbarbier/Desktop/matplotlib
    Build dir: /Users/josephbarbier/Desktop/matplotlib/build/cp310
    Build type: native build
    Program python3 python found: NO found 3.10.5 but need: '>= 3.11'

../../meson.build:6:4: ERROR: Program 'python3 python' not found or not executable

A full log can be found at /Users/josephbarbier/Desktop/matplotlib/build/cp310/meson-logs/meson-log.txt
error: subprocess-exited-with-error

× Preparing editable metadata (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: /Users/josephbarbier/Desktop/matplotlib/venv/bin/python /Users/josephbarbier/Desktop/matplotlib/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_editable /var/folders/m2/jfzxyg4s0xz3jyw5f94r7tcm0000gn/T/tmpwu3byzgi
cwd: /Users/josephbarbier/Desktop/matplotlib
Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Expected outcome

Successfully install matplotlib in development mode.

Additional information

  • I'm not sure why I have this version of Python installed here

  • I tried with pip latest (25.1.1), and it doesn't change anything

  • meson-log.txt

Build started at 2025-05-11T19:18:42.156591
Main binary: /Users/josephbarbier/Desktop/matplotlib/venv/bin/python
Build Options: -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/josephbarbier/Desktop/matplotlib/build/cp310/meson-python-native-file.ini
Python system: Darwin
The Meson build system
Version: 1.8.0
Source dir: /Users/josephbarbier/Desktop/matplotlib
Build dir: /Users/josephbarbier/Desktop/matplotlib/build/cp310
Build type: native build
Running command: /Users/josephbarbier/Desktop/matplotlib/venv/bin/python --version
--- stdout ---
Python 3.10.5

--- stderr ---

Program python3 python found: NO found 3.10.5 but need: '>= 3.11'

../../meson.build:6:4: ERROR: Program 'python3 python' not found or not executable

Operating system

MacOS Sequoia 15.4.1

Matplotlib Version

3.10.3

Matplotlib Backend

macosx

Python version

Python 3.10.5

Jupyter version

No response

Installation

pip

@rcomer
Copy link
Member

rcomer commented May 12, 2025

I'm not certain but I think venv environments inherit the python version from whatever python you create them with. Since #29904, you genuinely do need python 3.11 or later. Personally I use conda (actually mamba) to create my dev environment, which defaults to using the most recent python version it can. I know that plenty of maintainers here do not use conda so maybe someone will be along later with a non-conda solution.

@dstansby
Copy link
Member

Yes, given this line in your error message:

Program python3 python found: NO found 3.10.5 but need: '>= 3.11'

could you try again with a newer Python version than 3.10?

@jklymak
Copy link
Member

jklymak commented May 12, 2025

Yes, if you are on macOS never use the system Python except perhaps for little system scripts. It's usually quite a few versions behind anything scientific Python is going to require.

@JosephBARBIERDARNAL
Copy link
Contributor Author

Yep, probably not the best way of doing it. I ended up using uv, it was much easier.

Would you be interested in a PR that adds uv to this page? It would be OS-independent, much faster and less prone to error (such as the one I did).

@tacaswell
Copy link
Member

I am very hesitant to recommend uv, it has some incompatibilities with Matplotlib (see astral-sh/uv#6893 (comment)).

If we are going to add anything we should add pixi instructions and/or also add a Matplotlib setup to https://github.com/rgommers/pixi-dev-scipystack (or have our own version).

@jklymak
Copy link
Member

jklymak commented May 15, 2025

I'd be quite interested in a pixi setup. I tried on my Mac, but got caught by the clang issues not finding the headers.

@story645
Copy link
Member

story645 commented May 15, 2025

Yep, probably not the best way of doing it. I ended up using uv, it was much easier.

Would you be interested in a PR that adds uv to this page?

UV (and pixie) got added to the install page (https://matplotlib.org/devdocs/) so seems reasonable in a tab provided things work? With the same caveats as the install instructions?

I sorta think we can't fight that people are gonna install things their usual way, so we may as well document it?

My guess is more tabs here https://matplotlib.org/devdocs/devel/development_setup.html#create-a-dedicated-environment and maybe change the section name from environments to somehing more generic.

@JosephBARBIERDARNAL
Copy link
Contributor Author

My guess is more tabs here https://matplotlib.org/devdocs/devel/development_setup.html#create-a-dedicated-environment and maybe change the section name from environments to somehing more generic.

Having an extra tab here (after the first two) seems fair to me. It just needs to have that same warning from the devdocs?

@timhoffm
Copy link
Member

The warning would need to be slightly different:

  • What does the uv issue mean for them? In particular would tkagg based tests fail or are they silently dropped?
  • Also we need to check what's in the dev environment. I don't know of the top of my head, but it can well be that other GUI toolkits are already in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants