How to install opencv-python in python 3.8

2024/9/28 15:19:48

I'm having problem during the installation of opencv-python in pycharm. After opening pycharm I click on settings and then project interpreter, I click on '+' and search for the correct module, I started the installation but it fails with

Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python

Additionally I tried installing it through console but I get the same error. I also have updated to the last pip version, how can I solve this?

Answer

EDIT / UPDATE: You can now install through pip, support was added to python 3.8

OpenCV is not yet (officially) compatible with python 3.8. this version of python is quite new and lots of pip packages can't be installed on it (yet). You can verify that at the bottom of the PyPi page for OpenCV

Three possible solutions:

  1. Downgrade to python 3.7.5 and install the package through pip as you normally would, and wait for an officially supported version before trying again with python 3.8
  2. Try building OpenCV from source files yourself. This might require quite a bit of technical knowledge and might ultimately fail anyway without some changes to the source. If you're interested in that solution, start here for windows or here for linux
  3. There is a pre-built wheel available here that works with python 3.8, but it is unofficial (but the source here is quite credible) - this is probably the easiest choice to set up

Also, you can track when support will come to python 3.8 in this GitHub issue

https://en.xdnf.cn/q/71320.html

Related Q&A

python augmented assignment for boolean operators

Does Python have augmented assignment statements corresponding to its boolean operators?For example I can write this:x = x + 1or this:x += 1Is there something I can write in place of this:x = x and yT…

Change a pandas DataFrame column value based on another column value

I have a dataframe with two columns each of which represents an organism. They are called ORG1 and ORG2 I want to move the values of ORG2 into ORG1 for the corresponding index value.So, if ORG1 is A a…

How to lock a sqlite3 database in Python?

Is there a way to explicitly acquire a lock on a sqlite3 database in Python?

How to install pyzmq on an Alpine Linux container?

I have a container with the python:3.6-alpine kernel. I have a problem installing the pyzmq via pip on this: Dockerfile: FROM python:3.6-alpineRUN mkdir /code RUN apk add vim WORKDIR / ADD . /codedocke…

How to Get Value Out from the Tkinter Slider (Scale)?

So, here is the code I have, and as I run it, the value of the slider bar appears above the slider, I wonder is there a way to get that value out? Maybe let a=that value. ;)from Tkinter import *contr…

Python cassandra-driver OperationTimeOut on every query in Celery task

I have a problem with every insert query (little query) which is executed in celery tasks asynchronously. In sync mode when i do insert all done great, but when it executed in apply_async() i get this:…

Function which returns the least-squares solution to a linear matrix equation

I have been trying to rewrite the code from Python to Swift but Im stuck on the function which should return the least-squares solution to a linear matrix equation. Does anyone know a library written i…

Divide .csv file into chunks with Python

I have a large .csv file that is well over 300 gb. I would like to chunk it into smaller files of 100,000,000 rows each (each row has approximately 55-60 bytes).I wrote the following code:import panda…

Why cant I use operator.itemgetter in a multiprocessing.Pool?

The following program:import multiprocessing,operator f = operator.itemgetter(0) # def f(*a): return operator.itemgetter(0)(*a) if __name__ == __main__:multiprocessing.Pool(1).map(f, ["ab"])f…

Writing a compiler for a DSL in python

I am writing a game in python and have decided to create a DSL for the map data files. I know I could write my own parser with regex, but I am wondering if there are existing python tools which can do …