1
 ERROR: Command errored out with exit status 1: 'e:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mmusa\\AppData\\Local\\Temp\\pip-install-z5zd5j52\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\mmusa\\AppData\\Local\\Temp\\pip-install-z5zd5j52\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mmusa\AppData\Local\Temp\pip-record-wre2z2vk\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\overlay' --compile --install-headers 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\overlay\Include\numpy' Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\python\python.exe' 'e:\python\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.11.3; python_version=='"'"'3.5'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"'' Check the logs for full command output.

I get this error while installing opencv. I have upgraded my pip and I am currently using Python 3.9. Any help would be appreciated

Musaddiq
  • 13
  • 1
  • 1
  • 3
  • The important part of this error message is missing. Do you have build tools installed on your system? – sytech Nov 01 '20 at 07:45

5 Answers5

2

Note the opencv project readme does not yet state support for Python 3.9

Supported Python versions Python 3.x compatible pre-built wheels are provided for the officially supported Python versions (not in EOL):

  • 3.6
  • 3.7
  • 3.8

Without prebuilt wheels, you'll need to build it yourself. Make sure you have proper build tools installed on your system.

Also note:

on Windows, make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.

Alternatively, you can try downloading an unofficial wheel for opencv (and other dependencies) for Python 3.9 and installing from wheel files

sytech
  • 29,298
  • 3
  • 45
  • 86
1

Python 3.9 is supported in the latest version of opencv. source

0

I had the same problem here for downloading modern machine learning libraries(TensorFlow, sci-kit learn)So saw the TensorFlow documentation(official) it was indicating that we should python 3.3-3.8 for installing. I tried that and fortunately, it worked. Hope it works for you! So according to me, you should also install python 3.8

0

right now openCV is not supporting python 3.9

its better to use earlier version of python, like 3.5 so everything is in original and stable

aniket
  • 111
  • 1
  • 6
0

I hope this would help.

sudo apt update

sudo apt install python3-pip

pip3 install opencv-python