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 cannot choose orjson wheel for M1 macos #6573

Closed
4 tasks done
pszpetkowski opened this issue Sep 20, 2022 · 11 comments
Closed
4 tasks done

Poetry cannot choose orjson wheel for M1 macos #6573

pszpetkowski opened this issue Sep 20, 2022 · 11 comments
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected status/needs-reproduction Issue needs a minimal reproduction to be confirmed

Comments

@pszpetkowski
Copy link

  • 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
@pszpetkowski pszpetkowski added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 20, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 20, 2022

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

if no then this is resolved by #6547

@pszpetkowski
Copy link
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.

@qhuang0411
Copy link

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

@pszpetkowski
Copy link
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.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 5, 2022

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

@neersighted neersighted added area/installer Related to the dependency installer status/needs-reproduction Issue needs a minimal reproduction to be confirmed and removed status/triage This issue needs to be triaged labels Oct 5, 2022
@neersighted
Copy link
Member

neersighted commented Oct 5, 2022

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.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
@Drachenfels
Copy link

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.

@kabartay
Copy link

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│ 

@neersighted
Copy link
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.

@dimbleby
Copy link
Contributor

#7177 (comment), upgrade your pip

Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected status/needs-reproduction Issue needs a minimal reproduction to be confirmed
Projects
None yet
Development

No branches or pull requests

6 participants