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.

architecture-specific binaries are preferred on macOS when universal2 should always be selected

See original GitHub issue

Description

If pip sees both x86_64 and universal2 wheels on an x86_64 machine, it will prefer to install x86_64 wheels, creating a partially-broken virtual environment that cannot be used to create universal2 (i.e. “broadly usable”) redistributables.

Expected behavior

I would expect that pip would prefer to install universal2 artifacts when available, so that when building an app with e.g. py2app in a virtual environment created with pip, I’d be able to create a universal2 application even if I don’t have an Apple Silicon mac handy.

This is particularly an issue because package maintainers who want to be friendly to older versions of pip that don’t support universal2 properly are creating architecture-specific binaries, and the existence of those creates a worse and more error-prone experience for newer, more up-to-date pip users.

pip version

22.3

Python version

3.11.0

OS

macOS

How to Reproduce

arch -arch x86_64 ./asdf/bin/python3 -m pip install cryptography

Output

Downloading http://127.0.0.1:3141/root/pypi/%2Bf/3fc/26e22840b7732/cryptography-38.0.1-cp36-abi3-macosx_10_10_x86_64.whl (2.8 MB)

Code of Conduct

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
albertosottilecommented, Nov 3, 2022

This is actually exacerbated by the impossibility of manually installing universal2 wheels when platform-specific wheels are also available (see https://github.com/pypa/pip/issues/5453).

0reactions
pradyunsgcommented, Dec 16, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Universal macOS Binary - Apple Developer
A universal binary runs natively on both Apple silicon and Intel-based Mac computers, because it contains executable code for both architectures. Turn all...
Read more >
"Apple Silicon" and packaging - Discussions on Python.org
macOS already supports binaries with multiple architectures, and that's something supported by CPython and setuptools for i386, x86_64, ppc and ...
Read more >
Options - cibuildwheel - Read the Docs
A list of architectures to build. On macOS, this option can be used to cross-compile between x86_64 , universal2 and arm64 for Apple...
Read more >
description - PyInstaller
PyInstaller is a program that freezes (packages) Python programs into stand-alone executables, under Windows, GNU/Linux, macOS, FreeBSD, OpenBSD, ...
Read more >
Porting Takua Renderer to 64-bit ARM- Part 2 - Code & Visuals
To understand why creating Universal 2 binaries can be so easy, ... create Universal Binaries; I'm fairly certain that the macOS lipo tool ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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