Error installing matplotlib

Rob Cliffe via Python-list <[email protected]>
Newsgroups gmane.comp.python.general
Message-ID <[email protected]>
Hello, can anyone help?  All assistance gratefully received.  I am 
running python 3.13.3 on a Windows 11 machine and trying to do
     pip install matplotlib
(No, I don't need to say "python -m ...", I am running the right version 
of python.exe.)
This starts by generating the following output (which I can catch by 
redirecting it to a file)

Collecting matplotlib
   Using cached matplotlib-3.10.6.tar.gz (34.8 MB)
   Installing build dependencies: started
   Installing build dependencies: finished with status 'done'
   Getting requirements to build wheel: started
   Getting requirements to build wheel: finished with status 'done'
   Installing backend dependencies: started
   Installing backend dependencies: finished with status 'done'
   Preparing metadata (pyproject.toml): started
   Preparing metadata (pyproject.toml): finished with status 'error'

then prints error messages on the screen which are scrolled out too fast 
to see, but end as follows:

3: note: in expansion of macro 'PYBIND11_COMPAT_STRDUP'
                        rec_fget->doc = 
PYBIND11_COMPAT_STRDUP(rec_fget->doc);
                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\robcl\AppData\Local\Temp\pip-build-env-1ud913ho\overlay\Lib\site-packages\pybind11\include/pybind11/pybind11.h:248:36: 
note: (if you use '-fpermissive', G++ will accept your code, but 
allowing the use of an undeclared name is deprecated)
        #    define PYBIND11_COMPAT_STRDUP strdup
                                           ^~~~~~
C:\Users\robcl\AppData\Local\Temp\pip-build-env-1ud913ho\overlay\Lib\site-packages\pybind11\include/pybind11/pybind11.h:2379:33: 
note: in expansion of macro 'PYBIND11_COMPAT_STRDUP'
                        rec_fget->doc = 
PYBIND11_COMPAT_STRDUP(rec_fget->doc);
                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\robcl\AppData\Local\Temp\pip-build-env-1ud913ho\overlay\Lib\site-packages\pybind11\include/pybind11/pybind11.h:248:36: 
error: there are no arguments to 'strdup' that depend on a template 
parameter, so a declaration of 'strdup' must be available [-fpermissive]
        #    define PYBIND11_COMPAT_STRDUP strdup
                                           ^~~~~~
C:\Users\robcl\AppData\Local\Temp\pip-build-env-1ud913ho\overlay\Lib\site-packages\pybind11\include/pybind11/pybind11.h:2387:33: 
note: in expansion of macro 'PYBIND11_COMPAT_STRDUP'
                        rec_fset->doc = 
PYBIND11_COMPAT_STRDUP(rec_fset->doc);
                                        ^~~~~~~~~~~~~~~~~~~~~~
       In file included from ../src/_backend_agg_basic_types.h:17,
                        from ../src/_backend_agg.h:41,
                        from ../src/_backend_agg_wrapper.cpp:6:
       ../src/py_adaptors.h: In member function 'void 
mpl::PathIterator::set(pybind11::object, pybind11::object, bool, double)':
       ../src/py_adaptors.h:96:57: warning: comparison of integer 
expressions of different signedness: 'pybind11::ssize_t' {aka 'int'} and 
'unsigned int' [-Wsign-compare]
                    if (m_codes.ndim() != 1 || m_codes.shape(0) != 
m_total_vertices) {
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
       ../src/_backend_agg_wrapper.cpp: In lambda function:
       ../src/_backend_agg_wrapper.cpp:253:37: warning: narrowing 
conversion of 'renderer->RendererAgg::get_height()' from 'unsigned int' 
to 'int' inside { } [-Wnarrowing]
                        renderer->get_height(),
                        ~~~~~~~~~~~~~~~~~~~~^~
       ../src/_backend_agg_wrapper.cpp:253:37: warning: narrowing 
conversion of 'renderer->RendererAgg::get_height()' from 'unsigned int' 
to 'int' inside { } [-Wnarrowing]
       ../src/_backend_agg_wrapper.cpp:254:36: warning: narrowing 
conversion of 'renderer->RendererAgg::get_width()' from 'unsigned int' 
to 'int' inside { } [-Wnarrowing]
                        renderer->get_width(),
                        ~~~~~~~~~~~~~~~~~~~^~
       ../src/_backend_agg_wrapper.cpp:254:36: warning: narrowing 
conversion of 'renderer->RendererAgg::get_width()' from 'unsigned int' 
to 'int' inside { } [-Wnarrowing]
       ../src/_backend_agg_wrapper.cpp:258:39: warning: narrowing 
conversion of '(renderer->RendererAgg::get_width() * 4)' from 'unsigned 
int' to 'int' inside { } [-Wnarrowing]
                        renderer->get_width() * 4,
                        ~~~~~~~~~~~~~~~~~~~~~~^~~
       ../src/_backend_agg_wrapper.cpp:258:39: warning: narrowing 
conversion of '(renderer->RendererAgg::get_width() * 4)' from 'unsigned 
int' to 'int' inside { } [-Wnarrowing]
       ninja: build stopped: subcommand failed.
       INFO: autodetecting backend as ninja
       INFO: calculating backend command to run: 
C:\Users\robcl\AppData\Local\Temp\pip-build-env-1ud913ho\normal\Scripts\ninja.EXE
       [end of output]

   note: This error originates from a subprocess, and is likely not a 
problem with pip.
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.

Best wishes
Rob Cliffe
-- 
https://mail.python.org/mailman3//lists/python-list.python.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.