Ask coding questions

← Back to all posts
Can`t use "opencv-python" in my project
Igor-Belskiy

Consol show me this:

Replit: Updating package configuration

--> python3 -m poetry add opencv-python
Using version ^4.5.4 for opencv-python

Updating dependencies
Resolving dependencies...

SolverProblemError

The current project's Python requirement (>=3.8,<4.0) is not compatible with some of the required packages Python requirement:
- numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.11,<4.0
- numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.11,<4.0
- numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.11,<4.0

Because no versions of numpy match >1.21.2,<1.21.3 || >1.21.3,<1.21.4 || >1.21.4
and numpy (1.21.2) requires Python >=3.7,<3.11, numpy is forbidden.
And because numpy (1.21.3) requires Python >=3.7,<3.11
and numpy (1.21.4) requires Python >=3.7,<3.11, numpy is forbidden.
Because no versions of opencv-python match >=4.5.4,<4.5.4.58 || >4.5.4.58,<5.0.0
and opencv-python (4.5.4.58) depends on numpy (>=1.21.2), opencv-python (>=4.5.4,<5.0.0) requires numpy (>=1.21.2).
Thus, opencv-python is forbidden.
So, because repl-python3-computervision-hands depends on opencv-python (^4.5.4), version solving failed.

at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes

• Check your dependencies Python requirement: The Python requirement can be specified via the python or markers properties

exit status 1

Replit: Package operation failed.


Looks like numpy can`t work with python 3.8 version.

Have any ideas how to solve this problem?

Voters
jospashd
kiyotakaobunai
Seefrass
NafisHandoko
Igor-Belskiy