adrn / thejoker

A custom Monte Carlo sampler for the (gravitational) two-body problem
MIT License
30 stars 8 forks source link

Building wheel for twobody (pyproject.toml): finished with status 'error' #133

Closed jvillasr closed 3 months ago

jvillasr commented 6 months ago

I'm trying to install the Joker on a clean conda environment. I'm getting the following error for twobody:

Collecting thejoker
  Using cached thejoker-1.3.0.tar.gz (2.1 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [133 lines of output]
      Collecting setuptools>=64
        Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
      Collecting setuptools_scm>=8
        Using cached setuptools_scm-8.1.0-py3-none-any.whl.metadata (6.6 kB)
      Collecting numpy
        Downloading numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl.metadata (61 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.1/61.1 kB 1.2 MB/s eta 0:00:00
      Collecting scipy
        Downloading scipy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl.metadata (60 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 6.8 MB/s eta 0:00:00
      Collecting cython
        Downloading Cython-3.0.10-cp39-cp39-macosx_10_9_x86_64.whl.metadata (3.2 kB)
      Collecting twobody
        Using cached twobody-0.9.0.tar.gz (117 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting packaging>=20 (from setuptools_scm>=8)
        Using cached packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
      Collecting typing-extensions (from setuptools_scm>=8)
        Using cached typing_extensions-4.11.0-py3-none-any.whl.metadata (3.0 kB)
      Collecting tomli>=1 (from setuptools_scm>=8)
        Using cached tomli-2.0.1-py3-none-any.whl.metadata (8.9 kB)
      Collecting astropy (from twobody)
        Downloading astropy-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl.metadata (9.8 kB)
      Collecting pyerfa>=2.0.1.1 (from astropy->twobody)
        Using cached pyerfa-2.0.1.4-cp39-abi3-macosx_10_9_x86_64.whl.metadata (5.7 kB)
      Collecting astropy-iers-data>=0.2024.2.26.0.28.55 (from astropy->twobody)
        Using cached astropy_iers_data-0.2024.5.6.0.29.28-py3-none-any.whl.metadata (5.1 kB)
      Collecting PyYAML>=3.13 (from astropy->twobody)
        Downloading PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl.metadata (2.1 kB)
      Using cached setuptools-69.5.1-py3-none-any.whl (894 kB)
      Using cached setuptools_scm-8.1.0-py3-none-any.whl (43 kB)
      Downloading numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl (20.6 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20.6/20.6 MB 27.0 MB/s eta 0:00:00
      Downloading scipy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl (39.3 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.3/39.3 MB 25.1 MB/s eta 0:00:00
      Using cached Cython-3.0.10-cp39-cp39-macosx_10_9_x86_64.whl (3.1 MB)
      Using cached packaging-24.0-py3-none-any.whl (53 kB)
      Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
      Downloading astropy-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl (6.5 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 25.9 MB/s eta 0:00:00
      Using cached typing_extensions-4.11.0-py3-none-any.whl (34 kB)
      Using cached astropy_iers_data-0.2024.5.6.0.29.28-py3-none-any.whl (1.9 MB)
      Using cached pyerfa-2.0.1.4-cp39-abi3-macosx_10_9_x86_64.whl (341 kB)
      Downloading PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl (197 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 197.8/197.8 kB 16.8 MB/s eta 0:00:00
      Building wheels for collected packages: twobody
        Building wheel for twobody (pyproject.toml): started
        Building wheel for twobody (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for twobody (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [69 lines of output]
            WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
            Traceback (most recent call last):
              File "/private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 36, in read_pyproject
                section = defn.get("tool", {})[tool_name]
            KeyError: 'setuptools_scm'
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.macosx-10.9-x86_64-cpython-39
            creating build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/barycenter.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/transforms.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/conftest.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/reference_plane.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/units.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/version.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/orbit.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/_astropy_init.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/elements.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/utils.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/anomaly.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/bary_trends.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/setup_package.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            creating build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_elements.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_anomaly.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_reference_plane.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_bary_trends.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_orbit.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_transforms.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_api.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/test_barycenter.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            copying twobody/tests/setup_package.py -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/tests
            creating build/lib.macosx-10.9-x86_64-cpython-39/twobody/src
            copying twobody/src/twobody.h -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/src
            copying twobody/src/twobody.c -> build/lib.macosx-10.9-x86_64-cpython-39/twobody/src
            copying twobody/wrap.pyx -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            copying twobody/wrap.pxd -> build/lib.macosx-10.9-x86_64-cpython-39/twobody
            running build_ext
            /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-install-_l_xsxyt/twobody_058085265d434a33a1e27e79f0e033ef/twobody/wrap.pxd
              tree = Parsing.p_module(s, pxd, full_module_name)
            Compiling twobody/wrap.pyx because it changed.
            [1/1] Cythonizing twobody/wrap.pyx
            building 'twobody.wrap' extension
            creating build/temp.macosx-10.9-x86_64-cpython-39
            creating build/temp.macosx-10.9-x86_64-cpython-39/twobody
            creating build/temp.macosx-10.9-x86_64-cpython-39/twobody/src
            x86_64-apple-darwin13.4.0-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/joker2/include -arch x86_64 -I/opt/miniconda3/envs/joker2/include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/joker2/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/py38/include -D_FORTIFY_SOURCE=2 -isystem /opt/miniconda3/envs/py38/include -I/private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/include/malloc -Itwobody/ -I/opt/miniconda3/envs/joker2/include/python3.9 -c twobody/src/twobody.c -o build/temp.macosx-10.9-x86_64-cpython-39/twobody/src/twobody.o --std=gnu99
            twobody/src/twobody.c:98:12: warning: unused variable 'dM' [-Wunused-variable]
                double dM, E;
                       ^
            1 warning generated.
            x86_64-apple-darwin13.4.0-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/joker2/include -arch x86_64 -I/opt/miniconda3/envs/joker2/include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/joker2/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/py38/include -D_FORTIFY_SOURCE=2 -isystem /opt/miniconda3/envs/py38/include -I/private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/include/malloc -Itwobody/ -I/opt/miniconda3/envs/joker2/include/python3.9 -c twobody/wrap.c -o build/temp.macosx-10.9-x86_64-cpython-39/twobody/wrap.o --std=gnu99
            In file included from twobody/wrap.c:1257:
            In file included from /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4:
            In file included from /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
            In file included from /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
            /private/var/folders/sn/wc4gw9510bx0wq4s356qpvl16qjhjz/T/pip-build-env-0cszshiu/overlay/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
            #warning "Using deprecated NumPy API, disable it with " \
             ^
            1 warning generated.
            x86_64-apple-darwin13.4.0-clang -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/miniconda3/envs/joker2/lib -L/opt/miniconda3/envs/joker2/lib -L/opt/miniconda3/envs/joker2/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/miniconda3/envs/joker2/lib -L/opt/miniconda3/envs/joker2/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/miniconda3/envs/py38/lib -L/opt/miniconda3/envs/py38/lib -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/miniconda3/envs/py38/include -D_FORTIFY_SOURCE=2 -isystem /opt/miniconda3/envs/py38/include build/temp.macosx-10.9-x86_64-cpython-39/twobody/src/twobody.o build/temp.macosx-10.9-x86_64-cpython-39/twobody/wrap.o -o build/lib.macosx-10.9-x86_64-cpython-39/twobody/wrap.cpython-39-darwin.so
            ld: warning: -pie being ignored. It is only used when linking a main executable
            ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
            clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
            error: command '/opt/miniconda3/envs/py38/bin/x86_64-apple-darwin13.4.0-clang' failed with exit code 1
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for twobody
      Failed to build twobody
      ERROR: Could not build wheels for twobody, which is required to install pyproject.toml-based projects
      [end of output]

Could this be an architecture issue? I see that installation is trying to use x86_64-apple-darwin13.4.0-clang and I'm using an Apple M2 chip. Any idea how I could get around this?

jvillasr commented 6 months ago

Quick update, a colleague successfully installed it on a M2 mac, so I'm still not sure what is going wrong.

NikhilLim commented 6 months ago

I had a similar issue recently. Are you on the latest version of Python? You may want to try Python 3.11

jvillasr commented 6 months ago

Thanks, yes, I've tried python 3.10 and 3.11 and I get the same issue.

adrn commented 3 months ago

Sorry for the long delay -- I've been on paternity leave. Did you both ever resolve this issue? One question for you: if you have an M2 chip, you should have an ARM version of conda. Do you? What does this output: conda info | grep platform

adrn commented 3 months ago

I just released new versions of twobody and thejoker that should hopefully resolve this issue -- sorry again for the delay!

adrn commented 3 months ago

(Please reopen this if you still run into the error)