Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
A-Telfer opened this issue May 16, 2021 · 10 comments
Closed
3 tasks done

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

A-Telfer opened this issue May 16, 2021 · 10 comments
Labels
kind/bug Something isn't working as expected

Comments

@A-Telfer
Copy link

A-Telfer commented May 16, 2021

  • 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.

@A-Telfer A-Telfer added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 16, 2021
@clintonroy
Copy link
Contributor

What error do you get?

@A-Telfer
Copy link
Author

Unable to find installation candidates for opencv-python-headless (4.5.2.52)

@A-Telfer A-Telfer changed the title Poetry can't install opencv-python-headless but pip can (RPI) Poetry can't install opencv but pip can (RPI) May 17, 2021
@epower
Copy link

epower commented May 18, 2021

I've found adding

[[tool.poetry.source]]
name = "piwheels"
url = "https://www.piwheels.org/simple/"

to the pyproject.toml file allows the correct candidate to be installed provided the relevant system dependencies are present.

@LorhanSohaky
Copy link

That happened to me

image

@jimmywan
Copy link

@A-Telfer Might want to try increasing the verbosity. Might give you more insight into what's going on.

poetry add -vvv opencv-python-headless

@A-Telfer
Copy link
Author

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

@A-Telfer
Copy link
Author

A-Telfer commented 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

@JexPY
Copy link

JexPY commented Dec 28, 2021

Same problem with PyJSON5 https://pyjson5.readthedocs.io/en/latest/index.html,

I tried poetry add pyjson5 but getting:

Installing pyjson5 (1.6.0.post1): Failed

  RuntimeError

  Unable to find installation candidates for pyjson5 (1.6.0.post1)

But specifying version solves the problem.

@clintonroy
Copy link
Contributor

Same problem with PyJSON5 https://pyjson5.readthedocs.io/en/latest/index.html,

I tried poetry add pyjson5 but getting:

Installing pyjson5 (1.6.0.post1): Failed

  RuntimeError

  Unable to find installation candidates for pyjson5 (1.6.0.post1)

The error's not great, but the problem is that there's no sdist for pyjson5, and only windows builds, check out pypi. Poetry should probably do better here, and take that into account when doing resolving. PyJson5 should definitely upload an sdist though.

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

7 participants