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.

Install wheel based on platform

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: OSX 10.14.6

  • Poetry version: Poetry 0.12.17

  • Link of a Gist with the contents of your pyproject.toml file: not helpful as local files would be necessary

Issue

Based on this documentation, the following should be possible:

[tool.poetry.dependencies]
...
my_package = [
    { platform = "linux", file = "./my_package-1.0.0-cp37-cp37m-linux_x86_64.whl"},
    { platform = "darwin", file = "./my_package-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl" },
]

Each dependency is correctly handled on its own (aka ignored/installed), but pip seems to always try to install the first dependency if ANY dependency inside the array matches. So the above construct works on linux but not on osx, exchanging the line order swaps the behavior.

I understand this might be annoying to reproduce since it requires two local wheels for different platforms.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:30
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
aatifsyedcommented, Nov 6, 2020

I’m also having difficulty with this:

poetry --version
Poetry version 1.1.4
[tool.poetry.dependencies]
# ...
# https://www.lfd.uci.edu/~gohlke/pythonlibs/
# https://stackoverflow.com/questions/54998028/how-do-i-install-pyaudio-on-python-3-7/54999645
pyaudio = [
    {path = "blobs/PyAudio-0.2.11-cp38-cp38-win_amd64.whl", platform = "windows" },
    {version = "0.2.11", platform = "linux" }
]
6reactions
hyliu1989commented, Nov 20, 2020

The same thing happened to me, and I am using poetry 1.1.4. I have a path dependency that will include different extras in different platform. Different extras only work in their specific platform. I have a marker saying “sys_platform == ‘win32’” and a second one saying “sys_platform == ‘darwin’”. It turns out the first one is chosen on MacOS and poetry tries to install the extra for win32, which failed. If I switch the order of the two constraints, poetry successfully install the constrained package on MacOS.

Could maintainer please reopen this issue? @abn

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install, download and build Python wheels - ActiveState
How to Build Python Wheels · Make sure Wheel and the latest version of setuptools is installed on your system by running: python...
Read more >
Pip install and platform specific wheels - python - Stack Overflow
1 Answer 1 ... PIP follows the PEP 425 Use recommendations; this stipulates how a binary distribution wheel is selected. Specifically, pip install...
Read more >
Platform compatibility tags - Python Packaging User Guide
The platform compatibility tagging model used for the wheel distribution format is defined in PEP ... and is based on a compatible Linux...
Read more >
What Are Python Wheels and Why Should You Care?
Python .whl files, or wheels, are a little-discussed part of Python, but they've been a boon to the installation process for Python packages....
Read more >
pip-custom-platform - PyPI
pip + wheel wrapper which allows you to choose a custom platform name for building, downloading, and installing wheels.
Read more >

github_iconTop Related Medium Post

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