Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug]: Igor2 cannot be imported using Python 3.12 #866

Closed
7 tasks done
SylviaWhittle opened this issue Jun 26, 2024 · 2 comments
Closed
7 tasks done

[Bug]: Igor2 cannot be imported using Python 3.12 #866

SylviaWhittle opened this issue Jun 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@SylviaWhittle
Copy link
Collaborator

SylviaWhittle commented Jun 26, 2024

Checklist

  • Re-run analysis with topostats process --core 1.
  • Describe the bug.
  • Include the configuration file.
  • Copy of the output.
  • The exact command that failed. This is what you typed at the command line, including any options.
  • TopoStats version, this is reported by topostats --version
  • Operating System and Python Version

Describe the bug

When developing on python 3.12, Igor2 fails to import due to some issue in Igor2's code relating to passing arguments to struct.

I would make an issue on their repo but I cannot find one

Unless we can somehow circumvent this, it seems we are locked in 3.12?

But how have the test runners been succeeding at this? Is it just my system? I'd appreciate someone else trying it.

Copy of the output

Here is me using python 3.11 successfully, then python 3.12 unsuccessfully.

❯ pip show igor2
Name: igor2
Version: 0.5.8
Summary: interface for reading binary IGOR files
Home-page: 
Author: Paul Kienzle, W. Trevor King, Aurelien Jaquier, Zbigniew Jędrzejewski-Szmek, Paul Müller
Author-email: 
License: GNU Lesser General Public License v3 or later (LGPLv3+)
Location: /opt/homebrew/Caskroom/miniforge/base/envs/topo-igor-test-311/lib/python3.11/site-packages
Requires: numpy
Required-by: AFMReader, topostats
❯ python
Python 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:26:40) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import igor2
>>> exit()
❯ conda deactivate
❯ conda activate 800_better_tracing
❯ pip show igor2
Name: igor2
Version: 0.5.5
Summary: interface for reading binary IGOR files
Home-page: 
Author: Paul Kienzle, W. Trevor King, Aurelien Jaquier, Zbigniew Jędrzejewski-Szmek, Paul Müller
Author-email: 
License: GNU Lesser General Public License v3 or later (LGPLv3+)
Location: /opt/homebrew/Caskroom/miniforge/base/envs/800_better_tracing/lib/python3.12/site-packages
Requires: numpy
Required-by: AFMReader, topostats
❯ pip install "igor2==0.5.8"
Collecting igor2==0.5.8
  Using cached igor2-0.5.8-py3-none-any.whl.metadata (2.7 kB)
Requirement already satisfied: numpy>=1.19.2 in /opt/homebrew/Caskroom/miniforge/base/envs/800_better_tracing/lib/python3.12/site-packages (from igor2==0.5.8) (1.26.4)
Using cached igor2-0.5.8-py3-none-any.whl (32 kB)
Installing collected packages: igor2
  Attempting uninstall: igor2
    Found existing installation: igor2 0.5.5
    Uninstalling igor2-0.5.5:
      Successfully uninstalled igor2-0.5.5
Successfully installed igor2-0.5.8
❯ python
Python 3.12.0 | packaged by conda-forge | (main, Oct  3 2023, 08:36:57) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import igor2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniforge/base/envs/800_better_tracing/lib/python3.12/site-packages/igor2/__init__.py", line 10, in <module>
    from . import binarywave
  File "/opt/homebrew/Caskroom/miniforge/base/envs/800_better_tracing/lib/python3.12/site-packages/igor2/binarywave.py", line 114, in <module>
    BinHeader1 = _Structure(  # `version` field pulled out into Wave
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Struct() takes at most 1 keyword argument (2 given)
>>> exit()
     ~/Documents/TopoStats     maxgamill-sh…tter-tracing *43 !4 ?2                                                                                          7s    4.05G    0B    800_better_tracing    23:31:41   
❯ 

Include the configuration file

N/A

To Reproduce

Import Igor2 in python 3.12

TopoStats Version

Git main branch

Python Version

3.12

Operating System

MacOS M1/M2 (post-2021)

Python Packages

Igor2 in versions 0.5.8 (latest) and 0.5.5 (just to check if it's only recent, as latest update was June 17th)

@SylviaWhittle SylviaWhittle added the bug Something isn't working label Jun 26, 2024
@ns-rse
Copy link
Collaborator

ns-rse commented Jun 27, 2024

See #15 Check Python 3.12 version compatibility which is suggested as a duplicate of my original report of Python 3.12 compatability (#9 Tests fail under Python 3.12).

Looking at your output you are using python-3.12.0 and the fix to the underlying cpython was made in python-3.12.2.

My environment where I don't see this problem is using python-3.12.4 and I can import both igor2-0.5.6 and igor2-0.5.8 (having just upgraded to check).

Solution

Probably upgrade to python>=3.12.2.

@ns-rse
Copy link
Collaborator

ns-rse commented Jun 27, 2024

Closing, not TopoStats issue and solution identified.

@ns-rse ns-rse closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants