0

I was trying to install matplotlib using pip. But i keep getting this output:

C:\Users\максим\Downloads>pip install matplotlib
Collecting matplotlib
  Using cached matplotlib-3.7.1.tar.gz (38.0 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [71 lines of output]
      Collecting certifi>=2020.06.20
        Using cached certifi-2023.5.7-py3-none-any.whl (156 kB)
      Collecting oldest-supported-numpy
        Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
      Collecting pybind11>=2.6
        Using cached pybind11-2.10.4-py3-none-any.whl (222 kB)
      Collecting setuptools_scm>=7
        Using cached setuptools_scm-7.1.0-py3-none-any.whl (43 kB)
      Collecting numpy==1.21.6 (from oldest-supported-numpy)
        Using cached numpy-1.21.6.zip (10.3 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 'error'
        error: subprocess-exited-with-error

        Getting requirements to build wheel did not run successfully.
        exit code: 1

        [40 lines of output]
        Traceback (most recent call last):
          File "C:\msys64\mingw64\lib\python3.10\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
            main()
          File "C:\msys64\mingw64\lib\python3.10\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "C:\msys64\mingw64\lib\python3.10\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 112, in get_requires_for_build_wheel
            backend = _build_backend()
          File "C:\msys64\mingw64\lib\python3.10\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
            obj = import_module(mod_path)
          File "C:\msys64\mingw64\lib\python3.10\importlib\__init__.py", line 126, in import_module
            return _bootstrap._gcd_import(name[level:], package, level)
          File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
          File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
          File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
          File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
          File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
          File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
          File "<frozen importlib._bootstrap_external>", line 887, in exec_module
          File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
          File "C:\Users\максим\AppData\Local\Temp\pip-build-env-_zf9l8a_\overlay\lib\python3.10\site-packages\setuptools\__init__.py", line 242, in <module>
            monkey.patch_all()
          File "C:\Users\максим\AppData\Local\Temp\pip-build-env-_zf9l8a_\overlay\lib\python3.10\site-packages\setuptools\monkey.py", line 99, in patch_all
            patch_for_msvc_specialized_compiler()
          File "C:\Users\максим\AppData\Local\Temp\pip-build-env-_zf9l8a_\overlay\lib\python3.10\site-packages\setuptools\monkey.py", line 162, in patch_for_msvc_specialized_compiler
            patch_func(*msvc9('find_vcvarsall'))
          File "C:\Users\максим\AppData\Local\Temp\pip-build-env-_zf9l8a_\overlay\lib\python3.10\site-packages\setuptools\monkey.py", line 149, in patch_params
            mod = import_module(mod_name)
          File "C:\msys64\mingw64\lib\python3.10\importlib\__init__.py", line 126, in import_module
            return _bootstrap._gcd_import(name[level:], package, level)
          File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
          File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
          File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
          File "<frozen importlib._bootstrap_external>", line 887, in exec_module
          File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
          File "C:\Users\максим\AppData\Local\Temp\pip-build-env-_zf9l8a_\overlay\lib\python3.10\site-packages\setuptools\_distutils\msvc9compiler.py", line 295, in <module>
            raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
        distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error

      Getting requirements to build wheel 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.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.

I tried to make so-called direct installation i got this:

\Downloads>pip install matplotlib-3.7.1-cp311-cp311-win_amd64 
ERROR: Could not find a version that satisfies the requirement matplotlib-3.7.1-cp311-cp311-win_amd64 (from versions: none)
ERROR: No matching distribution found for matplotlib-3.7.1-cp311-cp311-win_amd64

And here is the recomended command from the book i learn:

C:\Users\максим\Downloads>python -m pip install matplotlib-3.7.1-cp311-cp311-win_amd64.whl
ERROR: matplotlib-3.7.1-cp311-cp311-win_amd64.whl is not a supported wheel on this platform.

I also tryed to add python311 to the Path variable and execute python -m pip install -U matplotlib --prefer-binary but it gives me:

 DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)

I downloaded the last version of python and the corresponding matplotlib version. It didn't help. So how can i solve this problem and install matplotlib?

uradon
  • 11
  • 4
  • You are referring to python3.11, but the error message is from a 3.10 python isntallation through mingw. Are you maybe not using the python version you think you are using? – FlyingTeller May 23 '23 at 13:55
  • I recommend using the [Anaconda Distribution](https://www.anaconda.com/products/individual), it's likely to make your life much easier. All packages are installed as precompiled binaries. [Package List](https://docs.anaconda.com/anaconda/packages/py3.8_win-64/). **If you are using Anaconda, do not use `pip` to install packages that exist within the `conda` ecosystem.** Use `conda install package`. Only use `pip` if the package is not available with `conda install`. Using `pip` can potentially wreck your installation because `pip` and `conda` do not manage dependencies in the same way. – Trenton McKinney May 23 '23 at 16:55
  • Yeah it showed me 3.10.10 after executing `python -V`. How do i change it? – uradon May 23 '23 at 17:56
  • Does this answer your question? [msys2/mingw64: pip: VC 6.0 is not supported by this module](https://stackoverflow.com/questions/52166914/msys2-mingw64-pip-vc-6-0-is-not-supported-by-this-module) – sds Aug 15 '23 at 14:51

0 Answers0