question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry can't install opencv but pip can (RPI)

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate. NOTE: there are some similar mac os ones, but some of the solutions are targeted at macs and none worked for me.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Raspbian, release 10
  • Poetry version: 1.16

Issue

poetry add opencv-python-headless fails, but pip install opencv-python-headless works.

This is my first time using poetry and it’s not going very well. I’ve spent a few hours searching around for solutions but no luck, the closest I’ve come is #3621 (I tried many of the solutions in the linked issues), I’ve tried installing different versions of opencv, upgrading pip, reinstalling poetry… nothing has worked so far.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
A-Telfercommented, May 23, 2021

Without specifying the version it tries to install the latest pip version (4.5.2.52) and fails. The reason pip works on the RPI without specifying the version is that it seems to search piwheels first and install 4.5.1.48.

It would be nice if poetry could be configured to have the same behavior as pip

2reactions
A-Telfercommented, May 23, 2021

Thanks for the suggestions, I got it working

  1. Following @epower, I added piwheels to the pyproject.toml file
[[tool.poetry.source]]
name = "piwheels"
url = "https://www.piwheels.org/simple/"
  1. Look on piwheels to find which opencv versions are supported, then explicitly add it. eg poetry add opencv-python-headless==4.5.1.48
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install opencv package in a Raspberry pi - Stack Overflow
1 Answer 1 · sudo apt install python-opencv libopencv-dev · y/n --> y · sudo apt install python python-pip · y/n --> y...
Read more >
Cannot install project using poetry (#218) · Issues - GitLab
As an experiment, I generated a requirements.txt from my linux install (i.e. without the piwheels source) using pip list --format=freeze and ...
Read more >
can't install opencv on my pi - Raspberry Pi Stack Exchange
3 's dnn Python module. I've found here a description of how OpenCV can be installed with pip but I'm getting the following...
Read more >
opencv-python-headless - PyPI
Wrapper package for OpenCV python bindings.
Read more >
Installing and getting started — seaborn 0.12.1 documentation
Resolving this issue will involve sorting out the paths on your system, but it can sometimes be avoided by invoking pip with python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found