Skip to content

Poetry cannot choose orjson wheel for M1 macos #6573

Closed as not planned
Closed as not planned

Description

@pszpetkowski
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Poetry is unable to choose the orjson wheel for M1 macos i.e. https://files.pythonhosted.org/packages/74/71/5024229c3e6ca20ba069fd4428e322c3e038a881320491e7b9fe98a2df88/orjson-3.8.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl when orjson 3.8 is specified in pyproject.toml dependencies, and instead goes for the plain tar.gz (https://files.pythonhosted.org/packages/0a/de/282b8ca582b63e39e9ef7069c47c7be617d201e47ae435da851f7ffe61d1/orjson-3.8.0.tar.gz) and tries to build it.

Meanwhile if installed with pip, the proper wheel (URL mentioned above) is used:

$ python3 -m pip install orjson
Collecting orjson
  Downloading orjson-3.8.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (483 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 483.2/483.2 kB 8.2 MB/s eta 0:00:00
Installing collected packages: orjson
Successfully installed orjson-3.8.0

Activity

  1. dimbleby commented on Sep 20, 2022

    @dimbleby
    Contributor

    is this during installation, or during locking? does poetry lock succeed?

    if no then this is resolved by #6547

  2. pszpetkowski commented on Sep 20, 2022

    @pszpetkowski
    Author

    This happens during installation, I'm currently unable to verify if poetry lock works.

    Tomorrow I'll test the latest master of poetry to find out if #6547 fixed the issue.

  3. qhuang0411 commented on Oct 4, 2022

    @qhuang0411

    Did you solve the problem? I have the same issue now.

  4. pszpetkowski commented on Oct 5, 2022

    @pszpetkowski
    Author

    Nope and unfortunately I cannot install poetry from commit in my environment and will have to wait for the next release to verify if it still occurs.

  5. dimbleby commented on Oct 5, 2022

    @dimbleby
    Contributor

    since neither of you has provided any output showing either what you are doing or what the result is, it's going to be hard for anyone to offer any help

  6. added
    area/installerRelated to the dependency installer
    status/needs-reproductionIssue needs a minimal reproduction to be confirmed
    and removed
    status/triageThis issue needs to be triaged
    on Oct 5, 2022
  7. neersighted commented on Oct 5, 2022

    @neersighted
    Member

    I'm unable to reproduce this on a M1 mac using Poetry 1.2.1. When I install using the pyproject provided or poetry add orjson, I end up with orjson-3.8.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl as expected.

    I suspect this issue is external to Poetry -- maybe your Python is not reporting the correct compatible tags. python -m pip install packaging; python3 -c 'import packaging.tags; list(packaging.tags.compatible_tags())' may be informative if you run it with your problematic Python; however, as I cannot reproduce this in a clean macOS VM with a Homebrew-built Python, I am closing this for now.

    If you can reproduce this, the output of the above command plus details on how your Python is built/installed will be necessary.

  8. Drachenfels commented on Jan 18, 2023

    @Drachenfels

    Different hardware (pc) and different software (Ubuntu) and had very same issue, in my case it was cache of poetry that got garbled somehow. I just went to $HOM/.cache/pypoetry found an existing (and cached) orsjon and nuked it out of this planet, after that poetry add worked just fine.

  9. kabartay commented on Jan 24, 2023

    @kabartay

    poetry add orjson

    this gives error and no installation done

    • Installing orjson (3.8.5): Failed
    
    CalledProcessError 
    

    Command '['/venv/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/venv', '--no-deps', '/home/.cache/pypoetry/artifacts/d3/e7/5a/d917a8adba1c2617ef5c67ddd5aab133e6df329301662da55d71fd0331/orjson-3.8.5-cp38-cp38-manylinux_2_28_x86_64.whl']' returned non-zero exit status 1.

    repeats similar multiple times and

    at /usr/lib/python3.8/subprocess.py:516 in run
           512│             # We don't call process.wait() as .__exit__ does that for us.
           513│             raise
           514│         retcode = process.poll()
           515│         if check and retcode:
        →  516│             raise CalledProcessError(retcode, process.args,
           517│                                      output=stdout, stderr=stderr)
           518│     return CompletedProcess(process.args, retcode, stdout, stderr)
           519│ 
           520│ 
    

    The following error occurred when trying to handle this error:
    EnvCommandError

    Command ['/venv/bin/python', '-m', 'pip', 'install', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/venv', '--no-deps', '/home/.cache/pypoetry/artifacts/d3/e7/5a/d917a8adba1c2617ef5c67ddd5aab133e6df329301662da55d71fd0331/orjson-3.8.5-cp38-cp38-manylinux_2_28_x86_64.whl'] errored with the following return code 1, and output: ERROR: orjson-3.8.5-cp38-cp38-manylinux_2_28_x86_64.whl is not a supported wheel on this platform.

    and finally goes to

    The following error occurred when trying to handle this error:
      PoetryException
    

    Failed to install /home/reminiz/.cache/pypoetry/artifacts/d3/e7/5a/d917a8adba1c2617ef5c67ddd5aab133e6df329301662da55d71fd0331/orjson-3.8.5-cp38-cp38-manylinux_2_28_x86_64.whl

      at venv/lib/python3.8/site-packages/poetry/utils/pip.py:58 in pip_install
           54│ 
           55│     try:
           56│         return environment.run_pip(*args)
           57│     except EnvCommandError as e:
        →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
           59│ 
    
  10. neersighted commented on Jan 24, 2023

    @neersighted
    Member

    That's a partial duplicate of #7161, and is caused by pip not having updated their vendored dependencies yet. There's not a great workaround yet, please see that issue for details.

  11. dimbleby commented on Jan 24, 2023

    @dimbleby
    Contributor

    #7177 (comment), upgrade your pip

  12. github-actions commented on Feb 29, 2024

    @github-actions

    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.

  13. locked as resolved and limited conversation to collaborators on Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/bugSomething isn't working as expectedstatus/needs-reproductionIssue needs a minimal reproduction to be confirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions