I have a new computer so have installed python v 3.14, and the newest VS Code IDE. But when I try to install opencv (pip install opencv-python) I get the following.
(myvenv) C:\Users\xxx\Documents\MyPythonFolder>pip install opencv-python
Collecting opencv-python
Using cached opencv_python-4.12.0.88-cp37-abi3-win_amd64.whl.metadata (19 kB)
Collecting numpy<2.3.0,>=2 (from opencv-python)
Using cached numpy-2.2.6.tar.gz (20.3 MB)
Installing build dependencies … done
Getting requirements to build wheel … done
Installing backend dependencies … done
Preparing metadata (pyproject.toml) … error
error: subprocess-exited-with-error× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
- C:\Users\xxx\Documents\MyPythonFolder\myvenv\Scripts\python.exe C:\Users\xxx\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576\vendored-meson\meson\meson.py setup C:\Users\xxx\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576 C:\Users\xxx\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576.mesonpy-0z5u_5ea -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\RHELenovo\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576.mesonpy-0z5u_5ea\meson-python-native-file.ini
The Meson build system
Version: 1.5.2
Source dir: C:\Users\xxxxx***\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576
Build dir: C:\Users\***xxxxxx\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576.mesonpy-0z5u_5ea
Build type: native build
Project name: NumPy
Project version: 2.2.6
WARNING: Failed to activate VS environment: Could not parse vswhere.exe output..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']] The following exception(s) were encountered: Running `icl ""` gave "[WinError 2] The system cannot find the file specified" Running `cl /?` gave "[WinError 2] The system cannot find the file specified" Running `cc --version` gave "[WinError 2] The system cannot find the file specified" Running `gcc --version` gave "[WinError 2] The system cannot find the file specified" Running `clang --version` gave "[WinError 2] The system cannot find the file specified" Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified" Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified" A full log can be found at C:\Users\RHELenovo\AppData\Local\Temp\pip-install-y8k8fcdk\numpy_46815f35414146c686e6d506f1ae0576\.mesonpy-0z5u_5ea\meson-logs\meson-log.txt [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.
╰─> numpynote: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I successfully installed numpy
I tried reinstalling VS Code but the error still happens.
My system is Windows 11 with all the current updates on a Lenovo I5 laptop.
Any help would be appreciated as I am trying to learn OpenCV for a project.
Thanks
Fred