1

I was trying to install matplotlib but I'm getting this long error. I don't really have any idea what is wrong.

ERROR: Command errored out with exit status 1:
     command: 'C:\Python310\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Bilguun\\AppData\\Local\\Temp\\pip-install-5dbg4g23\\matplotlib_2ff15b65402b457db67b768d26133471\\setup.py'"'"'; __file__='"'"'C:\\Users\\Bilguun\\AppData\\Local\\Temp\\pip-install-5dbg4g23\\matplotlib_2ff15b65402b457db67b768d26133471\\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\Bilguun\AppData\Local\Temp\pip-pip-egg-info-hmkaun62'
         cwd: C:\Users\Bilguun\AppData\Local\Temp\pip-install-5dbg4g23\matplotlib_2ff15b65402b457db67b768d26133471\
    Complete output (282 lines):
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: 'C:\Python310\python.exe' 'C:\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\Bilguun\AppData\Local\Temp\tmp2vupi6yj'        
           cwd: C:\Users\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051
      Complete output (233 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\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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 ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      blis_info:
        libraries blis not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      openblas_info:
        libraries openblas not found in ['C:\\Python310\\lib', 
'C:\\', 'C:\\Python310\\libs']
      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:\MinGW\bin\gfortran.exe
      Using built-in specs.
      COLLECT_GCC=C:\MinGW\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
      Target: mingw32
      Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
      Thread model: win32
      gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
        NOT AVAILABLE

      accelerate_info:
        NOT AVAILABLE

      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries tatlas not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      atlas_3_10_blas_info:
        libraries satlas not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      atlas_blas_info:
        libraries f77blas,cblas,atlas not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      C:\Users\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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 ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      C:\Users\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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 ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      openblas_lapack_info:
        libraries openblas not found in ['C:\\Python310\\lib', 
'C:\\', 'C:\\Python310\\libs']
      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:\MinGW\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
      Target: mingw32
      Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
      Thread model: win32
      gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
        NOT AVAILABLE

      openblas_clapack_info:
        libraries openblas,lapack not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
      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:\MinGW\bin\gfortran.exe
      COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
      Target: mingw32
      Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
      Thread model: win32
      gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
        NOT AVAILABLE

      flame_info:
        libraries flame not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in C:\Python310\lib   
        libraries tatlas,tatlas not found in C:\Python310\lib  
        libraries lapack_atlas not found in C:\
        libraries tatlas,tatlas not found in C:\
        libraries lapack_atlas not found in C:\Python310\libs  
        libraries tatlas,tatlas not found in C:\Python310\libs 
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE

      atlas_3_10_info:
        libraries lapack_atlas not found in C:\Python310\lib   
        libraries satlas,satlas not found in C:\Python310\lib  
        libraries lapack_atlas not found in C:\
        libraries satlas,satlas not found in C:\
        libraries lapack_atlas not found in C:\Python310\libs  
        libraries satlas,satlas not found in C:\Python310\libs 
      <class 'numpy.distutils.system_info.atlas_3_10_info'>    
        NOT AVAILABLE

      atlas_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in C:\Python310\lib   
        libraries ptf77blas,ptcblas,atlas not found in C:\Python310\lib
        libraries lapack_atlas not found in C:\
        libraries ptf77blas,ptcblas,atlas not found in C:\     
        libraries lapack_atlas not found in C:\Python310\libs  
        libraries ptf77blas,ptcblas,atlas not found in C:\Python310\libs
      <class 'numpy.distutils.system_info.atlas_threads_info'> 
        NOT AVAILABLE

      atlas_info:
        libraries lapack_atlas not found in C:\Python310\lib   
        libraries f77blas,cblas,atlas not found in C:\Python310\lib
        libraries lapack_atlas not found in C:\
        libraries f77blas,cblas,atlas not found in C:\
        libraries lapack_atlas not found in C:\Python310\libs  
        libraries f77blas,cblas,atlas not found in C:\Python310\libs
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE

      lapack_info:
        libraries lapack not found in ['C:\\Python310\\lib', 'C:\\', 'C:\\Python310\\libs']
        NOT AVAILABLE

      C:\Users\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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\Bilguun\AppData\Local\Temp\pip-wheel-pl_1iot6\numpy_c3c60903cf3b4f4d8adb6cfb88649051\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:\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 "C:\Python310\lib\site-packages\setuptools\installer.py", line 75, in fetch_build_egg
        subprocess.check_call(cmd)
      File "C:\Python310\lib\subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['C:\\Python310\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\Bilguun\\AppData\\Local\\Temp\\tmpq3kp_gfg', '--quiet', 'numpy>=1.16']' 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\Bilguun\AppData\Local\Temp\pip-install-5dbg4g23\matplotlib_2ff15b65402b457db67b768d26133471\setup.py", line 258, in <module>
        setup(  # Finally, pass this all along to distutils to 
do the heavy lifting.
      File "C:\Python310\lib\site-packages\setuptools\__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "C:\Python310\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "C:\Python310\lib\site-packages\setuptools\dist.py", line 806, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(    
      File "C:\Python310\lib\site-packages\pkg_resources\__init__.py", line 766, in resolve
        dist = best[req.key] = env.best_match(
      File "C:\Python310\lib\site-packages\pkg_resources\__init__.py", line 1051, in best_match
        return self.obtain(req, installer)
      File "C:\Python310\lib\site-packages\pkg_resources\__init__.py", line 1063, in obtain
        return installer(requirement)
      File "C:\Python310\lib\site-packages\setuptools\dist.py", line 877, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "C:\Python310\lib\site-packages\setuptools\installer.py", line 77, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['C:\\Python310\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\Bilguun\\AppData\\Local\\Temp\\tmpq3kp_gfg', '--quiet', 'numpy>=1.16']' returned non-zero exit status 1.

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

    BUILDING MATPLOTLIB
      matplotlib: yes [3.4.1]
          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]
           tests: no  [skipping due to configuration]
          macosx: no  [Mac OS-X only]
user202729
  • 3,358
  • 3
  • 25
  • 36
  • Please try and install using conda – Jody Klymak Oct 05 '21 at 12:37
  • _How_ are you trying to install it? What environment are you running, which python version? – LoKat Oct 05 '21 at 12:42
  • 4
    first: error shows `NumPy 1.21.2 may not yet support Python 3.10`. Python `3.10` is fresh version so better use `3.9` and wait few month until `3.10` will be better tested and all modules will support `3.10` – furas Oct 05 '21 at 13:29
  • 1
    second: in many places you have `NOT AVAILABLE` which shows what you may have to install. It can be some `C/C++` modules which are NOT python module and you have to install it manually. Because `numpy` uses `C/C++` code so it needs C/C++ compiler for this and you may need to install it. See line `gcc version 6.3.0 (MinGW.org GCC-6.3.0-1) NOT AVAILABLE` – furas Oct 05 '21 at 13:31
  • sometimes the best solution for Windows users is to use [Anaconda](https://www.anaconda.com/products/individual) instead of pure `Python`. `Anaconda` was created for Scientists (which don't have to know how to use compilers, etc.) and it install original Python with many precompiled modules (and they don't need C/C++ compiler) – furas Oct 05 '21 at 13:38
  • 1
    there is also [Unofficial Windows Binaries for Python Extension Packages](https://www.lfd.uci.edu/~gohlke/pythonlibs/) which also has precompiled modules for different Python versions. – furas Oct 05 '21 at 13:40
  • BTW: you could even use `3.8` instead of `3.10`. I see `Anaconda` still use `3.8` – furas Oct 05 '21 at 13:43
  • I recommend using the [Anaconda Distribution](https://www.anaconda.com/products/individual), it's likely to make your life much easier. [Package List](https://docs.anaconda.com/anaconda/packages/py3.8_win-64/) – Trenton McKinney Oct 05 '21 at 14:03
  • I got the same error. I am working on a Windows 10 machine. Switching to python 3.9.7 fixed the problem. If you want to have everything under control, I suggest you do that. If you just want to code and not mind installing everything manually, I agree with some of the other comments here that suggest you to switch to anaconda. – Heath Oct 06 '21 at 07:18

3 Answers3

0

I found a solution to this problem only by removing the fuc-ng python 3.10 and installing python 3.9.7 I think the problem will be solved a little later, but for now you can just use not the newest python version

0

This is a duplicate of this post which has a legitimate but temporary (unstable) solution.

0

Click this link and install matplotlib package for the python version you installed on your machine. Then go to command prompt, change your directory to the folder where you downloaded matplotlib and type:

py -m pip install matplotlib-3.4.3-cp310-cp310-win_amd64.whl
RiveN
  • 2,595
  • 11
  • 13
  • 26