AOtools / soapy

A Python Adaptive Optics Simulation
GNU General Public License v3.0
85 stars 32 forks source link

Incompatible with Python3.12 (for Linux at least) #137

Closed CJones-Optics closed 11 months ago

CJones-Optics commented 12 months ago

G'day! My system updated to python3.12 and pip can't seem to get SOAPY working on this version. I just downgraded the virtual environment and it works fine in 3.11.

Output from pip

Defaulting to user installation because normal site-packages is not writeable
Collecting soapy
  Using cached soapy-0.13.2.tar.gz (558 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.7.0 in /usr/lib64/python3.12/site-packages (from soapy) (1.24.4)
Requirement already satisfied: scipy>=0.15.0 in /usr/lib64/python3.12/site-packages (from soapy) (1.11.1)
Collecting astropy>=1.0 (from soapy)
  Obtaining dependency information for astropy>=1.0 from https://files.pythonhosted.org/packages/11/22/feb62f8a539219817d52cc206f046cac604bf6962e135e7b9eab59fc4e6b/astropy-5.3.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading astropy-5.3.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.4 kB)
Collecting aotools>=1.0 (from soapy)
  Using cached aotools-1.0.7-py3-none-any.whl (46 kB)
Collecting pyfftw>=0.12.0 (from soapy)
  Downloading pyFFTW-0.13.1.tar.gz (114 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 114.4/114.4 kB 2.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 994, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/tmp/pip-build-env-_n0b2u1p/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/tmp/pip-build-env-_n0b2u1p/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/tmp/pip-build-env-_n0b2u1p/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

System Info: OS: Fedora Linux 39 Python Version: 3.12

Steps to reproduce:

  1. Create a new virtual environment in python3.12
  2. Run pip install soapy

Steps to bypass the problem

  1. Install python 3.11
  2. Create the virtual environment in python3.11 instead.

Cheers!

ojdf commented 11 months ago

Hi @CJones-Optics, yeah seems that python 3.12 has broken the install of a few packages including pyFFTW which is causing your problem. For the time being your solution of using 3.11 is the only one until they fix their install for 3.12.

I will close this as it is not a soapy specific issue.

Thanks!