# Trying to install opencv in pycharm

**URL:** <https://forum.opencv.org/t/trying-to-install-opencv-in-pycharm/17259>\
**Category:** Python\
**Tags:** pycharm, programming\
**Created:** [April 11, 2024, 6:19pm UTC](https://forum.opencv.org/t/trying-to-install-opencv-in-pycharm/17259 "2024-04-11T18:19:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krule](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@krule](https://forum.opencv.org/u/krule)\
**Post date:** [April 11, 2024, 6:19pm UTC](https://forum.opencv.org/t/trying-to-install-opencv-in-pycharm/17259/1 "2024-04-11T18:19:16Z")

</div>

So I am trying to install opencv in pycharm and get this message:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/e/ebc8f7f8f98ca7c8b039d02e3fb3376f0947fbb6.png)

Collecting opencv-python  
Using cached opencv-python-4.9.0.80.tar.gz (92.9 MB)  
Installing build dependencies: started  
Installing build dependencies: finished with status ‘error’

error: subprocess-exited-with-error

pip subprocess to install build dependencies did not run successfully.  
exit code: 1

[425 lines of output]  
Ignoring numpy: markers ‘python\_version == “3.6” and platform\_machine != “aarch64” and platform\_machine != “arm64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version == “3.7” and platform\_machine != “aarch64” and platform\_machine != “arm64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version == “3.8” and platform\_machine != “aarch64” and platform\_machine != “arm64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version \<= “3.9” and sys\_platform == “linux” and platform\_machine == “aarch64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version \<= “3.9” and sys\_platform == “darwin” and platform\_machine == “arm64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version == “3.9” and platform\_machine != “aarch64” and platform\_machine != “arm64”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version == “3.10” and platform\_system == “Darwin”’ don’t match your environment  
Ignoring numpy: markers ‘python\_version \>= “3.11”’ don’t match your environment  
Collecting cmake\>=3.1  
Using cached cmake-3.29.1.tar.gz (30 kB)  
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 ‘error’  
error: subprocess-exited-with-error

```
pip subprocess to install backend dependencies did not run successfully.
exit code: 1

[392 lines of output]
Collecting pathspec
  Using cached pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
Collecting ninja>=1.5
  Using cached ninja-1.11.1.1.tar.gz (132 kB)
  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'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pyproject_metadata
  Using cached pyproject_metadata-0.7.1-py3-none-any.whl.metadata (3.0 kB)
Collecting packaging>=19.0 (from pyproject_metadata)
  Using cached packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Using cached pathspec-0.12.1-py3-none-any.whl (31 kB)
Using cached pyproject_metadata-0.7.1-py3-none-any.whl (7.4 kB)
Using cached packaging-24.0-py3-none-any.whl (53 kB)
Building wheels for collected packages: ninja
  Building wheel for ninja (pyproject.toml): started
  Building wheel for ninja (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  Building wheel for ninja (pyproject.toml) did not run successfully.
  exit code: 1

  [360 lines of output]
  C:\Users\Korisnik\AppData\Local\Temp\pip-build-env-looa7met\overlay\lib\python3.10\site-packages\setuptools_scm\git.py:308: UserWarning: git archive did not support describe output
    warnings.warn("git archive did not support describe output")
  C:\Users\Korisnik\AppData\Local\Temp\pip-build-env-looa7met\overlay\lib\python3.10\site-packages\setuptools_scm\git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
    warnings.warn("unprocessed git archival found (no export subst applied)")

  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 17 2022 x64 v143' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 17 2022

    could not find any instance of Visual Studio.

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 17 2022 x64 v143' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 16 2019 x64 v142' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 16 2019

    could not find any instance of Visual Studio.

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 16 2019 x64 v142' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 15 2017 x64 v141' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 15 2017

    could not find any instance of Visual Studio.

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 15 2017 x64 v141' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Running

     'nmake' '-?'

    failed with:

     no such file or directory

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Running

     'nmake' '-?'

    failed with:

     no such file or directory

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.

  CMake Error at CMakeLists.txt:2 (PROJECT):
    Running

     'nmake' '-?'

    failed with:

     no such file or directory

  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator - failure
  --------------------------------------------------------------------------------

                  ********************************************************************************
                  scikit-build could not get a working generator for your system. Aborting build.

                  Building windows wheels for Python 3.10 requires Microsoft Visual Studio 2022.
  Get it with "Visual Studio 2017":

    https://visualstudio.microsoft.com/vs/

  Or with "Visual Studio 2019":

      https://visualstudio.microsoft.com/vs/

  Or with "Visual Studio 2022":

      https://visualstudio.microsoft.com/vs/

                  ********************************************************************************
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ninja
Failed to build ninja
ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects
[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 backend 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.  
[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.

Anyone knows how to fix?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [April 11, 2024, 9:49pm UTC](https://forum.opencv.org/t/trying-to-install-opencv-in-pycharm/17259/2 "2024-04-11T21:49:34Z")

</div>

since that is pycharm, you need to find support from the pycharm community.

we can support python but not pycharm.

---

<div class="post-metadata">

**Author:** ![baqwas](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@baqwas](https://forum.opencv.org/u/baqwas)\
**Post date:** [April 11, 2024, 11:37pm UTC](https://forum.opencv.org/t/trying-to-install-opencv-in-pycharm/17259/3 "2024-04-11T23:37:39Z")

</div>

Hello!

Just for the record since this is an old thread. PyCharm will install opencv-python effortlessly!

Navigate, in the Pycharm IDE,  
**Project** → **External Libraries** → **New** → **Python Package** → \<_specify the package you want to install_\>

If you encountered an error with your:  
`import cv2`  
statement, then use the context action to install the package by overriding the package name in the Helper message window.

Regards.  
P.S.  
FWIW, always use virtual environments when working with Pycharm - you probably know that already!
