Rolf-Hempel / PlanetarySystemStacker

Produce a sharp image of a planetary system object (moon, sun, planets) from many seeing-affected frames according to the "lucky imaging" technique.
274 stars 32 forks source link

Error when running on macOS Ventura Intel mac #65

Open bennetfabian opened 1 year ago

bennetfabian commented 1 year ago

Dear @Rolf-Hempel, dear other maintainers, first of all you deserve I would like to express my gratitude for the time and energy you invested into this project. It's awesome to have a platform-independent solution. I really hope you're able to help with my problem.

After successfully installing PlanetarySystemStacker I get the same error message as in #60 when I try to run PlanetarySystemStacker.

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

macOS Ventura 13.2.1 Python 3.11.2 (installed via Homebrew) pip 22.3.1 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)

Is there any tweak or workaround I could try on my end? Thank you very much in advance!

mdolenga commented 1 year ago

Hi Bennet - what I do is clone the latest sources, manually install the required pip packages, and then just run the app with python3 planetary_system_stacker.py - works perfectly. Be sure to get a change that was made in July about the numpy issue.

ubergarm commented 1 year ago

I'm having a similar issue on Arch linux with the error message:

RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

Looks related to #71 and the fact that I have newer Python:

$ python -V
Python 3.11.3

I followed @mdolenga 's work around and fixed it by running from source after forcing upgrade of numpy like so:

# clone the repo
git clone git@github.com:Rolf-Hempel/PlanetarySystemStacker.git
cd PlanetarySystemStacker
# setup a venv
python3 -m venv ./venv
source ./venv/bin/activate
python3 -m pip install --upgrade pip
# install from pip into the venv just to get the dependencies
pip install planetary-system-stacker
# save the dependency list
pip freeze > requirements.txt
# now edit requirements.txt and upgrade numpy to newer than whatever is installed
# s/numpy==1.22.4/numpy>1.22.4/
# now update numpy
pip install --upgrade -r requirements.txt
# finally run it manually
cd planetary_system_stacker/
python3 planetary_system_stacker.py

This is what my pip freeze looks like after doing this and it seems to be working running from source

$ git rev-parse --short HEAD
01f3625

$ pip freeze
astropy==5.3.3
contourpy==1.1.0
cycler==0.11.0
fonttools==4.42.1
imageio==2.31.3
kiwisolver==1.4.5
lazy_loader==0.3
matplotlib==3.7.2
networkx==3.1
numpy==1.25.2
opencv-python-headless==4.7.0.72
packaging==23.1
Pillow==10.0.0
planetary-system-stacker==0.9.4.2
psutil==5.9.5
pyerfa==2.0.0.3
pyparsing==3.0.9
PyQt5==5.15.9
PyQt5-Qt5==5.15.2
PyQt5-sip==12.12.2
python-dateutil==2.8.2
PyWavelets==1.4.1
PyYAML==6.0.1
scikit-image==0.21.0
scipy==1.11.2
six==1.16.0
tifffile==2023.8.30