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

repository with relative path wheels not working #9596

Closed
sangki81 opened this issue Aug 1, 2024 · 5 comments
Closed

repository with relative path wheels not working #9596

sangki81 opened this issue Aug 1, 2024 · 5 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@sangki81
Copy link

sangki81 commented Aug 1, 2024

Description

Hi, sorry for my bad English.

I'm trying to install the package mmcv from this repository: https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html

with pip, it works fine
pip install -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html

But with poetry it doesn't.
This is what I did:

poetry source add --priority=supplemental mmcv_repo https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html
poetry add --source mmcv_repo mmcv

which gives this error

404 Client Error: Not Found for url: https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html/mmcv-2.2.0-cp310-cp310-manylinux1_x86_64.whl

I guess the problem is this repo lists whls with relative path.
The repo shows:

./mmcv-2.2.0-cp310-cp310-manylinux1_x86_64.whl
./mmcv-2.2.0-cp310-cp310-win_amd64.whl
./mmcv-2.2.0-cp311-cp311-manylinux1_x86_64.whl
./mmcv-2.2.0-cp311-cp311-win_amd64.whl
./mmcv-2.2.0-cp312-cp312-manylinux1_x86_64.whl
./mmcv-2.2.0-cp38-cp38-manylinux1_x86_64.whl
./mmcv-2.2.0-cp38-cp38-win_amd64.whl
./mmcv-2.2.0-cp39-cp39-manylinux1_x86_64.whl
./mmcv-2.2.0-cp39-cp39-win_amd64.whl

thowse wheels works fine when I tried one of them by writing toml like this:

mmcv = {url = "https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/mmcv-2.2.0-cp310-cp310-manylinux1_x86_64.whl"}

Is there any solution or walkaround for this?

Workarounds

I'm afraid not, as far as I know

Poetry Installation Method

install.python-poetry.org

Operating System

Ubuntu 22.04

Poetry Version

1.8.3

Poetry Configuration

cache-dir = "/home/sangki81/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
repositories.mmcv.url = "https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html"
repositories.source1.url = "https://data.pyg.org/whl/torch-2.3.0%2Bcu121.html"
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/sangki81/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

[tool.poetry]
name = "test2"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[[tool.poetry.source]]
name = "mmcv_repo"
url = "https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html"
priority = "supplemental"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

Loading configuration file /home/sangki81/.config/pypoetry/config.toml
Adding repository mmcv_repo (https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html) and setting it as supplemental
Using virtualenv: /home/sangki81/.cache/pypoetry/virtualenvs/test2-CBRr_xMi-py3.10

  Stack trace:

  13  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:327 in run
       325│ 
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  12  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/application.py:190 in _run
       188│         self._load_plugins(io)
       189│ 
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│ 

  11  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│ 
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│ 

  10  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:473 in _run_command
       471│ 
       472│         if error is not None:
     → 473│             raise error
       474│ 
       475│         return terminate_event.exit_code

   9  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/application.py:457 in _run_command
       455│ 
       456│             if command_event.command_should_run():
     → 457│                 exit_code = command.run(io)
       458│             else:
       459│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

   8  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/commands/base_command.py:117 in run
       115│         io.input.validate()
       116│ 
     → 117│         return self.execute(io) or 0
       118│ 
       119│     def merge_application_definition(self, merge_args: bool = True) -> None:

   7  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/cleo/commands/command.py:61 in execute
        59│ 
        60│         try:
     →  61│             return self.handle()
        62│         except KeyboardInterrupt:
        63│             return 1

   6  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/commands/add.py:164 in handle
       162│             return 0
       163│ 
     → 164│         requirements = self._determine_requirements(
       165│             packages,
       166│             allow_prereleases=self.option("allow-prereleases"),

   5  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/commands/init.py:381 in _determine_requirements
       379│             elif "version" not in requirement:
       380│                 # determine the best version automatically
     → 381│                 name, version = self._find_best_version_for_package(
       382│                     requirement["name"],
       383│                     allow_prereleases=allow_prereleases,

   4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/commands/init.py:416 in _find_best_version_for_package
       414│ 
       415│         selector = VersionSelector(self._get_pool())
     → 416│         package = selector.find_best_candidate(
       417│             name, required_version, allow_prereleases=allow_prereleases, source=source
       418│         )

   3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/version/version_selector.py:37 in find_best_candidate
        35│             },
        36│         )
     →  37│         candidates = self._pool.find_packages(dependency)
        38│         only_prereleases = all(c.version.is_unstable() for c in candidates)
        39│ 

   2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/repositories/repository_pool.py:212 in find_packages
       210│         repository_name = dependency.source_name
       211│         if repository_name:
     → 212│             return self.repository(repository_name).find_packages(dependency)
       213│ 
       214│         packages: list[Package] = []

   1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/repositories/repository_pool.py:136 in repository
       134│ 
       135│     def repository(self, name: str) -> Repository:
     → 136│         return self._get_prioritized_repository(name).repository
       137│ 
       138│     def get_priority(self, name: str) -> Priority:

  IndexError

  Repository "mmcv" does not exist.

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/repositories/repository_pool.py:145 in _get_prioritized_repository
      141│     def _get_prioritized_repository(self, name: str) -> PrioritizedRepository:
      142│         name = name.lower()
      143│         if self.has_repository(name):
      144│             return self._repositories[name]
    → 145│         raise IndexError(f'Repository "{name}" does not exist.')
      146│ 
      147│     def add_repository(
      148│         self,
      149│         repository: Repository,
@sangki81 sangki81 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 1, 2024
@dimbleby
Copy link
Contributor

dimbleby commented Aug 1, 2024

Duplicate #6885, already fixed, please close

@sangki81
Copy link
Author

sangki81 commented Aug 1, 2024

I'm using the most rescent poetry version 1.8.3 and did not add trailing slash.
Yes, this seems to be a duplicate of #6885,
but I've gone through the thread #6885 multiple times, nontheless still don't get what the solution is.
I blame my bad English, but could you give more detailed explanation, please?

@dimbleby
Copy link
Contributor

dimbleby commented Aug 1, 2024

the fix is not yet released, to use it you will need to use poetry from the main branch

@sangki81
Copy link
Author

sangki81 commented Aug 2, 2024

Thanks.
That solved my problem.

Besides, for whoever might be interested, this is what I did. (I'm not sure whether this is the right way):

curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git

and this ended up with version 1.9.0.dev0.

@sangki81 sangki81 closed this as completed Aug 2, 2024
Copy link

github-actions bot commented Sep 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 Sep 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 status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants