简体   繁体   English

Matplotlib Python 3.10 的安装问题

[英]Matplotlib Installation issues with Python 3.10

First, I do not believe this is a duplicate post of matplotlib installation issue python 3 this issue is relevant to matplotlib and Python 3.10 which was just recently released. First, I do not believe this is a duplicate post of matplotlib installation issue python 3 this issue is relevant to matplotlib and Python 3.10 which was just recently released.

My Problem我的问题

I am having issues installing matplotlib with Python 3.10.我在使用Python 3.10. I did not have these issues Python 3.9.6 .我没有这些问题Python 3.9.6 When installing matplotlib, I referenced the official instructions and I used the following command:在安装matplotlib的时候,参考了官方的说明,使用了如下命令:

  • python -m pip install -U matplotlib

Then I got this very long error message:然后我收到了这个很长的错误信息:

WARNING: Discarding https://files.pythonhosted.org/packages/7d/d4/e4c40c62cd8608ca09f0684e64139c56512e195f2351ac41a472d4dc8b38/matplotlib-3.3.0.tar.gz#sha256=24e8db94948019d531ce0bcd637ac24b1c8f6744ac86d2aa0eb6dbaeb1386f82 (from https://pypi.org/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached matplotlib-3.2.2.tar.gz (40.3 MB)
    ERROR: Command errored out with exit status 1:
     command: 'D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\serap\\AppData\\Local\\Temp\\pip-install-z6821kj4\\matplotlib_dd551371f0ba45a889cb056fa0e24291\\setup.py'"'"'; __file__='"'"'C:\\Users\\serap\\AppData\\Local\\Temp\\pip-install-z6821kj4\\matplotlib_dd551371f0ba45a889cb056fa0e24291\\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'"'"'))' egg_info --egg-base 'C:\Users\serap\AppData\Local\Temp\pip-pip-egg-info-iiicui1u'
         cwd: C:\Users\serap\AppData\Local\Temp\pip-install-z6821kj4\matplotlib_dd551371f0ba45a889cb056fa0e24291\
    Complete output (277 lines):
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: 'D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\Scripts\python.exe' 'D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\serap\AppData\Local\Temp\tmpinu_l323'
           cwd: C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de
      Complete output (225 lines):
      setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
        warnings.warn(
      Running from numpy source directory.
      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\tools\cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
        from distutils.version import LooseVersion
      Processing numpy/random\_bounded_integers.pxd.in
      Processing numpy/random\bit_generator.pyx
      Processing numpy/random\mtrand.pyx
      Processing numpy/random\_bounded_integers.pyx.in
      Processing numpy/random\_common.pyx
      Processing numpy/random\_generator.pyx
      Processing numpy/random\_mt19937.pyx
      Processing numpy/random\_pcg64.pyx
      Processing numpy/random\_philox.pyx
      Processing numpy/random\_sfc64.pyx
      Cythonizing sources
      blas_opt_info:
      blas_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      blis_info:
        libraries blis not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_info:
        libraries openblas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
      get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
      customize GnuFCompiler
      Could not locate executable g77
      Could not locate executable f77
      customize IntelVisualFCompiler
      Could not locate executable ifort
      Could not locate executable ifl
      customize AbsoftFCompiler
      Could not locate executable f90
      customize CompaqVisualFCompiler
      Could not locate executable DF
      customize IntelItaniumVisualFCompiler
      Could not locate executable efl
      customize Gnu95FCompiler
      Found executable C:\Program Files (x86)\mingw-w64\mingw32\bin\gfortran.exe
      Using built-in specs.
      COLLECT_GCC=C:\Program Files (x86)\mingw-w64\mingw32\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86)/mingw-w64/mingw32/bin/../libexec/gcc/i686-w64-mingw32/8.1.0/lto-wrapper.exe
      Target: i686-w64-mingw32
      Configured with: ../../../src/gcc-8.1.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-pkgversion='i686-posix-dwarf-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/lib -L/c/mingw810/prerequisites/i686-zlib-static/lib -L/c/mingw810/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
      Thread model: posix
      gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
        NOT AVAILABLE

      accelerate_info:
        NOT AVAILABLE

      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries tatlas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_3_10_blas_info:
        libraries satlas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries ptf77blas,ptcblas,atlas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_info:
        libraries f77blas,cblas,atlas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\numpy\distutils\system_info.py:2026: UserWarning:
          Optimized (vendor) Blas libraries are not found.
          Falls back to netlib Blas library which has worse performance.
          A better performance should be easily gained by switching
          Blas library.
        if self._calc_info(blas):
      blas_info:
        libraries blas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\numpy\distutils\system_info.py:2026: UserWarning:
          Blas (http://www.netlib.org/blas/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [blas]) or by setting
          the BLAS environment variable.
        if self._calc_info(blas):
      blas_src_info:
        NOT AVAILABLE

      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\numpy\distutils\system_info.py:2026: UserWarning:
          Blas (http://www.netlib.org/blas/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [blas_src]) or by setting
          the BLAS_SRC environment variable.
        if self._calc_info(blas):
        NOT AVAILABLE

      non-existing path in 'numpy\\distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
        libraries mkl_rt not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_lapack_info:
        libraries openblas not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
      get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
      customize GnuFCompiler
      customize IntelVisualFCompiler
      customize AbsoftFCompiler
      customize CompaqVisualFCompiler
      customize IntelItaniumVisualFCompiler
      customize Gnu95FCompiler
      Using built-in specs.
      COLLECT_GCC=C:\Program Files (x86)\mingw-w64\mingw32\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86)/mingw-w64/mingw32/bin/../libexec/gcc/i686-w64-mingw32/8.1.0/lto-wrapper.exe
      Target: i686-w64-mingw32
      Configured with: ../../../src/gcc-8.1.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-pkgversion='i686-posix-dwarf-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/lib -L/c/mingw810/prerequisites/i686-zlib-static/lib -L/c/mingw810/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
      Thread model: posix
      gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
        NOT AVAILABLE

      openblas_clapack_info:
        libraries openblas,lapack not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
      get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
      customize GnuFCompiler
      customize IntelVisualFCompiler
      customize AbsoftFCompiler
      customize CompaqVisualFCompiler
      customize IntelItaniumVisualFCompiler
      customize Gnu95FCompiler
      Using built-in specs.
      COLLECT_GCC=C:\Program Files (x86)\mingw-w64\mingw32\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86)/mingw-w64/mingw32/bin/../libexec/gcc/i686-w64-mingw32/8.1.0/lto-wrapper.exe
      Target: i686-w64-mingw32
      Configured with: ../../../src/gcc-8.1.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/i686-w64-mingw32-static --with-pkgversion='i686-posix-dwarf-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/include -I/c/mingw810/prerequisites/i686-zlib-static/include -I/c/mingw810/prerequisites/i686-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/i686-810-posix-dwarf-rt_v6-rev0/mingw32/opt/lib -L/c/mingw810/prerequisites/i686-zlib-static/lib -L/c/mingw810/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
      Thread model: posix
      gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
        NOT AVAILABLE

      flame_info:
        libraries flame not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries tatlas,tatlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries lapack_atlas not found in C:\
        libraries tatlas,tatlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE

      atlas_3_10_info:
        libraries lapack_atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries satlas,satlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries lapack_atlas not found in C:\
        libraries satlas,satlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE

      atlas_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries ptf77blas,ptcblas,atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries lapack_atlas not found in C:\
        libraries ptf77blas,ptcblas,atlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE

      atlas_info:
        libraries lapack_atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries f77blas,cblas,atlas not found in D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib
        libraries lapack_atlas not found in C:\
        libraries f77blas,cblas,atlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE

      lapack_info:
        libraries lapack not found in ['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\numpy\distutils\system_info.py:1858: UserWarning:
          Lapack (http://www.netlib.org/lapack/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [lapack]) or by setting
          the LAPACK environment variable.
        return getattr(self, '_calc_info_{}'.format(name))()
      lapack_src_info:
        NOT AVAILABLE

      C:\Users\serap\AppData\Local\Temp\pip-wheel-99zdamg9\numpy_e42242834a6f47f2b97c9e7786bac5de\numpy\distutils\system_info.py:1858: UserWarning:
          Lapack (http://www.netlib.org/lapack/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [lapack_src]) or by setting
          the LAPACK_SRC environment variable.
        return getattr(self, '_calc_info_{}'.format(name))()
        NOT AVAILABLE

      numpy_linalg_lapack_lite:
        FOUND:
          language = c
          define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]

      Warning: attempted relative import with no known parent package
      C:\Users\serap\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build\src.win-amd64-3.10
      creating build\src.win-amd64-3.10\numpy
      creating build\src.win-amd64-3.10\numpy\distutils
      building library "npymath" sources
      error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
      ----------------------------------------
      ERROR: Failed building wheel for numpy
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\installer.py", line 75, in fetch_build_egg
        subprocess.check_call(cmd)
      File "C:\Users\serap\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\serap\\AppData\\Local\\Temp\\tmpniofxxvj', '--quiet', 'numpy>=1.11']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\serap\AppData\Local\Temp\pip-install-z6821kj4\matplotlib_dd551371f0ba45a889cb056fa0e24291\setup.py", line 236, in <module>
        setup(
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\dist.py", line 785, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\pkg_resources\__init__.py", line 766, in resolve
        dist = best[req.key] = env.best_match(
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\pkg_resources\__init__.py", line 1051, in best_match
        return self.obtain(req, installer)
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\pkg_resources\__init__.py", line 1063, in obtain
        return installer(requirement)
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\dist.py", line 844, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "D:\GitHub\CodexGigas\PythonCrashCourse\chapter15\.project-env\lib\site-packages\setuptools\installer.py", line 77, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['D:\\GitHub\\CodexGigas\\PythonCrashCourse\\chapter15\\.project-env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\serap\\AppData\\Local\\Temp\\tmpniofxxvj', '--quiet', 'numpy>=1.11']' returned non-zero exit status 1.

    Edit setup.cfg to change the build options; suppress output with --quiet.

    BUILDING MATPLOTLIB
      matplotlib: yes [3.2.2]
          python: yes [3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC
                      v.1929 64 bit (AMD64)]]
        platform: yes [win32]
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]
             agg: yes [installing]
           tkagg: yes [installing; run-time loading from Python Tcl/Tk]
          macosx: no  [Mac OS-X only]

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/9c/4b/06f4aa9bef6b5e4f177881b4dedd94faa6e7cb3d95dfaeaa8a1a8b541095/matplotlib-3.2.2.tar.gz#sha256=3d77a6630d093d74cbbfebaa0571d00790966be1ed204e4a8239f5cbd6835c5d (from https://pypi.org/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached matplotlib-3.2.1.tar.gz (40.3 MB)

Then, after the error message, the pip attempts to install matplotlib again, only to fail and repeat the same error message;然后,在出现错误信息后,pip 再次尝试安装 matplotlib,结果失败并重复同样的错误信息; as if it was caught in a continuously loop until I ended it, Again I didn't have this issue with Python 3.9.6 therefore, I am assuming this has something to do with Python's new release perhaps.好像它在我结束它之前一直处于循环中,我再次没有遇到Python 3.9.6的这个问题,因此,我假设这可能与 Python 的新版本有关。

I also tried the following commands我还尝试了以下命令

  • pip install matplotlib
  • python3 install matplotlib

My Desired Solution我想要的解决方案

  1. I would like to know why am I getting the error message我想知道为什么我会收到错误消息
  2. I would like to install and use matplotlib with Python 3.10 ---> The easy way我想安装和使用matplotlibPython 3.10 --->简单的方法

Explain it to me like I am five-years old what am I doing wrong here?像我five-years old一样向我解释我在这里做错了什么?

Not totally sure, but I ran into the same issue.不完全确定,但我遇到了同样的问题。 After some digging and testing I think I've found out that Matplotlib, and pylab aren't compatible with python3.10 yet.经过一些挖掘和测试,我想我已经发现 Matplotlib 和 pylab 还不兼容 python3.10。 For the time being I've kept python3.9 along with 3.10 so whenever I use matplotlib, numpy, or pylab, I just use version 3.9.目前,我将 python3.9 与 3.10 一起保留,因此每当我使用 matplotlib、numpy 或 pylab 时,我只使用 3.9 版。

You need to switch to Python 3.8.您需要切换到 Python 3.8。

Use the following command to switch between the different alternatives:使用以下命令在不同的选项之间切换:

sudo update-alternatives --config python3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM