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 tries to install a version which is not present for the host OS

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.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Catalina 10.15.1
  • Poetry version: 1.0.5
  • Link of pyproject.toml

Issue

For a project, needed to install umap-learn which in turn needs tbb package from pypi.

On running poetry add umap-learn, the installation failed with

[EnvCommandError] Command ['/Users/username/Downloads/Projects/env/bin/pip', 'install', '--no-deps', '-U', 'tbb==2020.0.133'] errored with the following return code 1, and output: ERROR: Could not find a version that satisfies the requirement tbb==2020.0.133 (from versions: 2018.0.4.1, 2019.0) ERROR: No matching distribution found for tbb==2020.0.133

It seems like the above package is not available for my host OS as when using pip install umap-learn, the version installed is 2019.0.

If I try to do poetry add command again, it tries to still update the package and fails.

the verbose mode gives `PyPI: 1 packages found for umap-learn >=0.4.1,<0.5.0 1: fact: umap-learn (0.4.1) depends on numpy (>=1.15) 1: fact: umap-learn (0.4.1) depends on scikit-learn (>=0.20) 1: fact: umap-learn (0.4.1) depends on scipy (>=1.0) 1: fact: umap-learn (0.4.1) depends on numba (>=0.46,<0.47 || >0.47) 1: fact: umap-learn (0.4.1) depends on tbb (>=2019.0) 1: selecting umap-learn (0.4.1) 1: derived: tbb (>=2019.0) 1: derived: numba (>=0.46,<0.47 || >0.47) 1: derived: scipy (>=1.0) 1: derived: scikit-learn (>=0.20) 1: derived: numpy (>=1.15) PyPI: 2 packages found for tbb >=2019.0 1: selecting cython (0.29.15) 1: fact: celery (4.4.0) depends on pytz (>0.0-dev) 1: fact: celery (4.4.0) depends on billiard (>=3.6.1,<4.0) 1: fact: celery (4.4.0) depends on kombu (>=4.6.7,<4.7) 1: fact: celery (4.4.0) depends on vine (1.3.0) 1: selecting celery (4.4.0) 1: derived: vine (1.3.0) 1: derived: kombu (>=4.6.7,<4.7) 1: derived: billiard (>=3.6.1,<4.0) 1: derived: pytz (>0.0-dev) 1: fact: azure-storage (0.36.0) depends on azure-common (>=1.1.5) 1: fact: azure-storage (0.36.0) depends on azure-nspkg (>=2.0.0) 1: fact: azure-storage (0.36.0) depends on cryptography () 1: fact: azure-storage (0.36.0) depends on python-dateutil () 1: fact: azure-storage (0.36.0) depends on requests () 1: selecting azure-storage (0.36.0) 1: derived: requests () 1: derived: python-dateutil () 1: derived: cryptography () 1: derived: azure-nspkg (>=2.0.0) 1: derived: azure-common (>=1.1.5) 1: fact: sklearn (0.0) depends on scikit-learn () 1: selecting sklearn (0.0) 1: selecting pymongo (3.8.0) 1: selecting configparser (3.7.0) 1: fact: tensorflow-hub (0.7.0) depends on numpy (>=1.12.0) 1: fact: tensorflow-hub (0.7.0) depends on six (>=1.10.0) 1: fact: tensorflow-hub (0.7.0) depends on protobuf (>=3.4.0) 1: selecting tensorflow-hub (0.7.0) 1: derived: protobuf (>=3.4.0) 1: derived: six (>=1.10.0) 1: fact: flask (1.1.1) depends on Werkzeug (>=0.15) 1: fact: flask (1.1.1) depends on Jinja2 (>=2.10.1) 1: fact: flask (1.1.1) depends on itsdangerous (>=0.24) 1: fact: flask (1.1.1) depends on click (>=5.1) 1: selecting flask (1.1.1) 1: derived: click (>=5.1) 1: derived: itsdangerous (>=0.24) 1: derived: Jinja2 (>=2.10.1) 1: derived: Werkzeug (>=0.15) 1: fact: numba (0.48.0) depends on llvmlite (>=0.31.0dev0,<0.32.0) 1: fact: numba (0.48.0) depends on numpy (>=1.15) 1: selecting numba (0.48.0) 1: derived: llvmlite (>=0.31.0dev0,<0.32.0) 1: fact: scipy (1.4.1) depends on numpy (>=1.13.3) 1: selecting scipy (1.4.1) 1: fact: scikit-learn (0.22.1) depends on numpy (>=1.11.0) 1: fact: scikit-learn (0.22.1) depends on scipy (>=0.17.0) 1: fact: scikit-learn (0.22.1) depends on joblib (>=0.11) 1: selecting scikit-learn (0.22.1) 1: derived: joblib (>=0.11) 1: selecting numpy (1.18.1) 1: selecting vine (1.3.0) 1: fact: kombu (4.6.7) depends on amqp (>=2.5.2,<2.6) 1: fact: kombu (4.6.7) depends on importlib-metadata (>=0.18) 1: selecting kombu (4.6.7) 1: derived: importlib-metadata (>=0.18) 1: derived: amqp (>=2.5.2,<2.6) 1: selecting billiard (3.6.2.0) 1: selecting pytz (2019.3) 1: fact: requests (2.22.0) depends on chardet (>=3.0.2,❤️.1.0) 1: fact: requests (2.22.0) depends on idna (>=2.5,<2.9) 1: fact: requests (2.22.0) depends on urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26) 1: fact: requests (2.22.0) depends on certifi (>=2017.4.17) 1: selecting requests (2.22.0) 1: derived: certifi (>=2017.4.17) 1: derived: urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26) 1: derived: idna (>=2.5,<2.9) 1: derived: chardet (>=3.0.2,❤️.1.0) 1: fact: python-dateutil (2.8.1) depends on six (>=1.5) 1: selecting python-dateutil (2.8.1) 1: fact: cryptography (2.8) depends on six (>=1.4.1) 1: fact: cryptography (2.8) depends on cffi (>=1.8,<1.11.3 || >1.11.3) 1: selecting cryptography (2.8) 1: derived: cffi (>=1.8,<1.11.3 || >1.11.3) 1: selecting azure-nspkg (3.0.2) 1: selecting azure-common (1.1.24) 1: fact: protobuf (3.11.3) depends on six (>=1.9) 1: selecting protobuf (3.11.3) 1: selecting six (1.14.0) 1: selecting click (7.0) 1: selecting itsdangerous (1.1.0) 1: fact: jinja2 (2.11.1) depends on MarkupSafe (>=0.23) 1: selecting jinja2 (2.11.1) 1: derived: MarkupSafe (>=0.23) 1: selecting werkzeug (1.0.0) 1: selecting llvmlite (0.31.0) 1: selecting joblib (0.14.1) 1: fact: importlib-metadata (1.5.0) depends on zipp (>=0.5) 1: selecting importlib-metadata (1.5.0) 1: derived: zipp (>=0.5) 1: fact: amqp (2.5.2) depends on vine (>=1.1.3,<5.0.0a1) 1: selecting amqp (2.5.2) 1: selecting certifi (2019.11.28) 1: selecting urllib3 (1.25.8) 1: selecting idna (2.8) 1: selecting chardet (3.0.4) 1: fact: cffi (1.14.0) depends on pycparser () 1: selecting cffi (1.14.0) 1: derived: pycparser (*) 1: selecting markupsafe (1.1.1) 1: selecting zipp (2.2.0) 1: selecting pycparser (2.19) 1: selecting tbb (2020.0.133) 1: Version solving took 0.279 seconds. 1: Tried 1 solutions.

Writing lock file

Package operations: 2 installs, 0 updates, 0 removals

  • Installing tbb (2020.0.133)

[EnvCommandError] Command [‘/Users/username/Downloads/Projects/env/bin/pip’, ‘install’, ‘–no-deps’, ‘tbb==2020.0.133’] errored with the following return code 1, and output: ERROR: Could not find a version that satisfies the requirement tbb==2020.0.133 (from versions: 2018.0.4.1, 2019.0) ERROR: No matching distribution found for tbb==2020.0.133 `

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ligcommented, Jul 19, 2020

@ShamrockLee maybe, you have another issue of some kind. Installing the latest pip inside an environment created with poetry does help with resolving the issue with opencv-python 4.3.0.36. I’ve tested it on Fedora, Ubuntu and Centos with Python 3.6.

1reaction
felixgaocommented, Jun 30, 2021

I am also experiencing something similar. my Dockerfile

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential gcc libreadline-gplv2-dev libncursesw5-dev openssl \
    libssl-dev libsqlite3-dev tk-dev libgdbm-dev \
    libc6-dev libbz2-dev libffi-dev python3-dev python3-pip \
    libxml2-dev libxslt1-dev zlib1g zlib1g-dev python3-lxml \
    && rm -rf /var/lib/apt/lists/* \
    && mkdir /app

RUN pip install -U \
    pip \
    setuptools \
    wheel \
    poetry

WORKDIR /app

COPY poetry.lock pyproject.toml ./

RUN poetry run pip install --upgrade pip &&\
    poetry install --no-dev && \ 
    rm -rf ~/.cache/pypoetry/{cache,artifacts}

The pyproject.toml dependencies are

[tool.poetry.dependencies]
python = "^3.7"
paddlepaddle = "^2.1.1"
paddleocr = "^2.0.6"
Flask = "^2.0.1"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

When building the dockerfile opencv-python as a transitive dependency cannot be found

#10 102.5   • Installing opencv-python (4.2.0.32)
#10 103.0
#10 103.0   RuntimeError
#10 103.0
#10 103.0   Unable to find installation candidates for opencv-python (4.2.0.32)
#10 103.0
#10 103.0   at /usr/local/lib/python3.9/site-packages/poetry/installation/chooser.py:72 in choose_for
#10 103.1        68│
#10 103.1        69│             links.append(link)
#10 103.1        70│
#10 103.1        71│         if not links:
#10 103.1     →  72│             raise RuntimeError(
#10 103.1        73│                 "Unable to find installation candidates for {}".format(package)
#10 103.1        74│             )
#10 103.1        75│
#10 103.1        76│         # Get the best link
#10 103.1
#10 103.1   • Installing pandas (1.1.5)
#10 109.7   • Installing pre-commit (2.13.0)
#10 110.1   • Installing protobuf (3.17.3)
#10 110.6   • Installing requests (2.25.1)
#10 111.0   • Installing scikit-image (0.17.2)
#10 118.2   • Installing shapely (1.7.1)
#10 118.9   • Installing shellcheck-py (0.7.2.1)
------
executor failed running [/bin/sh -c poetry run pip install --upgrade pip &&    poetry install --no-dev &&     rm -rf ~/.cache/pypoetry/{cache,artifacts}]: exit code: 1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing a Python package using Poetry with trusted host and ...
I'm trying to upgrade an older project to use Poetry instead of requirements.txt. In the old requirements, there was this dependency:
Read more >
poetry - PyPI
Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. Poetry Install. Poetry replaces ...
Read more >
Installation — Psycopg 2.9.5 documentation
This will install a pre-compiled binary version of the module which does not require the build or runtime prerequisites described below.
Read more >
Using Python's pip to Manage Your Projects' Dependencies
There you'll learn how to install specific versions of a package or point pip to a different index that's not PyPI. In the...
Read more >
Ask HN: Why Poetry did not become a mainstream package ...
You can install pipenv using pip. It works /so much better/ than regular pip. Pipenv installs the right versions for the dependencies needed...
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