Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pip3 install failure on MacOS Monterey with M1 chip. Likely need arm64 tags. #46

Open
mdolenga opened this issue Jan 9, 2022 · 6 comments

Comments

@mdolenga
Copy link

mdolenga commented Jan 9, 2022

On my MacOS Monterey (M1) MacBook pro, using its default python3 installation, I encounter the following error when attempting to install PSS (this is successful on a Linux machine):

pip3 install planetary-system-stacker
ERROR: Could not find a version that satisfies the requirement planetary-system-stacker (from versions: none)
ERROR: No matching distribution found for planetary-system-stacker

If I run with more verbose output, I see repeated lines like this, one for each release:

  Skipping link: none of the wheel's tags (py3-none-macosx_10_6_intel) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/ee/22/c63d33f6d30cb46a3d8c662b0b6b9bd6fe02f561e4d11c1c21e0c4eadc96/planetary_system_stacker-0.9.0.3-py3-none-macosx_10_6_intel.whl#sha256=d8bc6d87a6ef2f935033a3c759b53068648b785c5bdfeb1f0e804098ba2a1139 (from https://pypi.org/simple/planetary-system-stacker/) (requires-python:>=3.5)

I ran pip3 debug -verbose to get a list of all the tags supported in my system, and I see these for python3:

py3-none-macosx_12_0_arm64
  py3-none-macosx_12_0_universal2
  py3-none-macosx_11_0_arm64
  py3-none-macosx_11_0_universal2
  py3-none-macosx_10_16_universal2
  py3-none-macosx_10_15_universal2
  py3-none-macosx_10_14_universal2
  py3-none-macosx_10_13_universal2
  py3-none-macosx_10_12_universal2
  py3-none-macosx_10_11_universal2
  py3-none-macosx_10_10_universal2
  py3-none-macosx_10_9_universal2
  py3-none-macosx_10_8_universal2
  py3-none-macosx_10_7_universal2
  py3-none-macosx_10_6_universal2
  py3-none-macosx_10_5_universal2
  py3-none-macosx_10_4_universal2

As you can see, there are no "intel" tags on my M1 system.

Subsequently, I installed an Intel only version of Python (3.8.8) on my M1 Mac, and with this version, python3.8 -m pip install planetary-system-stacker succeeds (I have not yet tested the app). While this may be a useful workaround for now, python.org is no longer releasing intel builds, so an update may be in order.

@mdolenga
Copy link
Author

I worked on creating an installer for native M1 Macs, the key issue has been that there is no Qt5 support for arm64. I have a PR for porting to Qt, and while it appears syntactically correct, there is a seg fault in the menubar startup of all places.

@Planet30
Copy link

Try this:

arch -x86_64 pip3 ....

@databu
Copy link

databu commented Aug 28, 2023

Any hope to fix this soon without the arch -x86_64 workaround? The latter stopped working for me.

Unfortunately I can't reproduce the original error I got, now my Python system seems in a weird arm64/x86_64 mixed state because I forgot to run it in a venv. When I try to install it again now I get

arch -x86_64 pip3 install planetary-system-stacker
arch: posix_spawnp: pip3: Bad CPU type in executable

@Rolf-Hempel
Copy link
Owner

I cannot help with problems on MacOS. I have no access to a Mac, and I have never used those machines.

On Cloudy Nights many Mac users exchanged experiences with installing PSS on their various Mac computers. Mac users often received help from the Mac user community there.

@mdolenga
Copy link
Author

mdolenga commented Sep 2, 2023

@databu - I didn't install planetary-system-stacker, just the dependencies manually. I cloned the git repo, removed from numpy import int as np_int and changed dtype=int where type = np_int in the stack_frames.py file.

Install a universal python build, I used 3.11. I then invoke PSS with python3 planetary_system_stacker.py

If I could figure out how to port this to the latest Qt (the licensing nonsense is concerning), I think that would finally get to a native M1 implementation.

@databu
Copy link

databu commented Sep 3, 2023

Ok I tried to follow that in a venv, because I have other software that needs newer numpy versions, but for some reason installing a <1.23 numpy in the venv didn't work (it installed ok, but when running pss, it still complained that numpy is >=1.23).
I then tried to pip3 install planetary-system-stacker in a docker image based on python:3.11-bullseye run with --platform linux/amd64, which seemed to install ok. But running pss then brought this error:

PlanetarySystemStacker 
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
Traceback (most recent call last):
  File "/usr/local/bin/PlanetarySystemStacker", line 5, in <module>
    from planetary_system_stacker.planetary_system_stacker import main
  File "/usr/local/lib/python3.11/site-packages/planetary_system_stacker/planetary_system_stacker.py", line 38, in <module>
    import matplotlib
  File "/usr/local/lib/python3.11/site-packages/matplotlib/__init__.py", line 129, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "/usr/local/lib/python3.11/site-packages/matplotlib/rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "/usr/local/lib/python3.11/site-packages/matplotlib/colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "/usr/local/lib/python3.11/site-packages/matplotlib/scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "/usr/local/lib/python3.11/site-packages/matplotlib/ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "/usr/local/lib/python3.11/site-packages/matplotlib/transforms.py", line 49, in <module>
    from matplotlib._path import (
ImportError: numpy.core.multiarray failed to import

I then tried downgrading numpy to 1.21 but that brought other errors.
At this point, I guess making it work natively on Apple Silicon, as well as with an up-to-date numpy version, just seems the most straight-forward. Unfortunately I have no clue about Qt development whatsoever. One might note that Stellarium recently upgraded to Qt6 and works mostly fine on Apple Silicon (there are some issues/quirks, but mostly ok). Same with Siril I believe.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants