Skip to content

Python > 3.13 not supported #739

@ARSadri

Description

@ARSadri

Hi py4DSTEM team,

Thank you for this excellent software. I am reporting a compatibility issue regarding the upcoming (or current) use of Python 3.13. While issue #710 is considered, here a quick fix is suggested for convenience of users.

Problem:

Python 3.13 is no longer compatible with NumPy 1.x versions (see NumPy 2.1.0 Release Notes). Since py4DSTEM currently relies on NumPy 1.x logic/dependencies, users attempting to install it on Python 3.13 will encounter installation failures or runtime crashes.

Evidence:

Similar issues have been documented across the ecosystem, such as in LangChain #26026, where it was confirmed that numpy < 2.0 fails on Python 3.13. You can also update your python, make a virtual environment and reproduce the error.

Suggested Fix:

Until py4DSTEM is fully migrated to NumPy 2.0+, I suggest adding an upper bound to the python_requires constraint in setup.py (and pyproject.toml if applicable) to prevent broken installs:
python

Current

python_requires=">=3.10"

Proposed

python_requires=">=3.10, <3.13"
Use code with caution.

This will ensure users are directed to a compatible Python environment (3.10–3.12) by pip automatically.
Best regards,
Alireza

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions