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 install" (1.2.0) installs the wrong torch version in the first time on OSX #6468

Closed
3 tasks done
chuanma opened this issue Sep 10, 2022 · 3 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@chuanma
Copy link

chuanma commented Sep 10, 2022

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

Issue

To reproduce this bug, first delete the poetry.lock if there is one. Then call poetry install twice. You will find that it fails in the first time, trying to install the wrong version (1.11.0+cpu) added for the linux platform. However, it works if you call poetry install again.

I guess that some cache was not removed after generating the poetry.lock file, and the cache caused the error, because it worked in the 2nd poetry install call.

➜  poetry install
...
Resolving dependencies... (0.9s)

Writing lock file

Package operations: 2 installs, 0 updates, 0 removals

  • Installing typing-extensions (4.3.0)
  • Installing torch (1.11.0+cpu): Failed

  RuntimeError

  Unable to find installation candidates for torch (1.11.0+cpu)

  at ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chooser.py:103 in choose_for
       99│
      100│             links.append(link)
      101│
      102│         if not links:
    → 103│             raise RuntimeError(f"Unable to find installation candidates for {package}")
      104│
      105│         # Get the best link
      106│         chosen = max(links, key=lambda link: self._sort_key(package, link))
      107│



➜  poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing torch (1.11.0)
@chuanma chuanma added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 10, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 10, 2022

Basically the same as #6150

poetry solves for versions and markers, paying no attention to what distributions are available. I think that is unlikely to change. 1.11.0+cpu should be a satisfactory version wherever 1.11.0 is written.

It should be sheer luck that your install works sometimes but not others (I am mildly surprised that it varies).

As in #6150, you may be better off asking the pytorch project to use a consistent versioning scheme, it seems curious that they attach +cpu on linux and windows but not on mac.

@chuanma
Copy link
Author

chuanma commented Sep 12, 2022

@dimbleby Agreed. I'll close this issue.

To help other people, some experiment results:

  • In Poetry 1.2.0, it's consistent that separately calling poetry lock and poetry install works for me.
  • In Poetry master branch (1.3.x), it always fails (trying to install 1.11.0+cpu on mac).

So if you are on 1.2.0, you may use this approach to temporarily avoid the issue.

@chuanma chuanma closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2022
@chuanma chuanma changed the title "poetry install" (1.2.0) installs the wrong torch version in the first time "poetry install" (1.2.0) installs the wrong torch version in the first time on OSX Sep 12, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Sep 18, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 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

3 participants