Reputation: 21
I am trying to install opencv with python using pip install opencv-python
but I am getting this error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Python310\python.exe' 'C:\Users\gnara\AppData\Local\Temp\pip-standalone-pip-_33ltocw\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\gnara\AppData\Local\Temp\pip-build-env-xl8kjguh\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'"'"''
cwd: None
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56)
ERROR: No matching distribution found for opencv-python
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'C:\Program Files\Python310\python.exe -m pip install --upgrade pip' command.
Upvotes: 1
Views: 19750
Reputation: 11
Step-by-Step Guide to Install OpenCV using Anaconda:
1- Open the Anaconda Prompt from your start menu or anaconda navigator,
2- If you have a specific environment where you write your code, activate it, i.e., "conda activate env_name", replace env_name with the name of your environment,
3- Run the following command to check if OpenCV is installed in the activated environment: "conda list opencv",
4- If OpenCV is not installed, install it using pip command: "pip install opencv-python", this should install OpenCV with Python 3.10.x
5- After the installation is complete, verify that OpenCV is installed by running the command in step3.
Upvotes: 0
Reputation: 81
pip install opencv-python
worked for me.
I had a clean environment (anaconda prompt), did not even install pip, but it still worked. My steps:
conda create -n envname
conda activate envname
conda install -c anaconda numpy
(I needed numpy, it installed python 3.10)conda install opencv-python
(did not work, prompt adviced me to search in other channel.)pip install opencv-python
(as sharmaji adviced)Everything works and my program that did not work bevore because opencv was missing, now works to.
Numpy 1.22.3 , opencv-python 4.6.0.66 and python 3.10.4
A lot more as well, but that's outside the scope of this topic.
Upvotes: 0
Reputation: 1
I have installed OpenCV with Python 3.10 on M1 using pip install opencv-python
I hope it will work on Windows and Linux as well.
Upvotes: 0
Reputation: 15387
Looks like there is no opencv-python
for Python 3.10... yet. Be patient.
This issue is being tracked already: https://github.com/opencv/opencv-python/issues?q=3.10
Upvotes: 4