I upgraded wheel, pip, and setuptools all to the latest version, with the following command.
pip3.9 install --upgrade pip setuptools wheel
When I try to install opencv pip3.9 install opencv-python
, It gives an error. I tried to install an older version, got the same error (4.5.5.62
). Here is the error I got, please have a look, thank you!
Python Version: 3.9 (opencv-python worked when it was 3.8)
Application: PyCharm
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/0v/j0nhw8p50yd3_w61mysphgjc0000gn/T/pip-build-env-rp7pv38q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 244, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/0v/j0nhw8p50yd3_w61mysphgjc0000gn/T/pip-build-env-rp7pv38q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 229, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/0v/j0nhw8p50yd3_w61mysphgjc0000gn/T/pip-build-env-rp7pv38q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/0v/j0nhw8p50yd3_w61mysphgjc0000gn/T/pip-build-env-rp7pv38q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 502, in <module>
main()
File "setup.py", line 239, in main
skbuild.setup(
File "/private/var/folders/0v/j0nhw8p50yd3_w61mysphgjc0000gn/T/pip-build-env-rp7pv38q/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 676, in setup
_classify_installed_files(
File "setup.py", line 442, in _classify_installed_files_override
return (cls.wraps._classify_installed_files)(
TypeError: _classify_installed_files() got an unexpected keyword argument 'cmake_install_dir'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
scikit-build
installed that is incompatible with the current release ofopencv-python
. Check out the latest state of theopencv-python
repository withgit
and then install from source usingpip3 install .
, that should work. – Lianne