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

Compatibility with python 3.12 #1061

Merged
merged 16 commits into from
Dec 10, 2024
Merged

Compatibility with python 3.12 #1061

merged 16 commits into from
Dec 10, 2024

Conversation

hoanphungt
Copy link
Contributor

No description provided.

Copy link
Contributor

@benvanbasten-ns benvanbasten-ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update README

@hoanphungt
Copy link
Contributor Author

@leendertvanwolfswinkel
Hi Leendert, I upgraded some wheels for the 3Di Result Analysis to make the plugin compatible with Python 3.12 (used by both QGIS LTR and non LTR). Could you include it into your release plan please? It's needed for the Rana Desktop Client.

@leendertvanwolfswinkel
Copy link
Collaborator

I tested it, but I get an error as soon as I activate the plugin

ImportError: cannot import name '_errors' from partially initialized module 'h5py' (most likely due to a circular import) (C:\Users\leendert.vanwolfswin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\threedi_results_analysis\deps\h5py\__init__.py) 
Traceback (most recent call last):
  File "C:\PROGRA~1/QGIS33~2.3/apps/qgis/./python\qgis\utils.py", line 404, in loadPlugin
    __import__(packageName)
  File "C:\PROGRA~1/QGIS33~2.3/apps/qgis/./python\qgis\utils.py", line 923, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\threedi_results_analysis\__init__.py", line 58, in 
    dependencies.check_importability()
  File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\threedi_results_analysis\dependencies.py", line 386, in check_importability
    imported_package = importlib.import_module(package)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\PROGRA~1\QGIS33~2.3\apps\Python312\Lib\importlib\__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\threedi_results_analysis\deps\h5netcdf\__init__.py", line 16, in 
    from .core import CompatibilityError, Dimension, File, Group, Variable  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\PROGRA~1/QGIS33~2.3/apps/qgis/./python\qgis\utils.py", line 923, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\threedi_results_analysis\deps\h5netcdf\core.py", line 9, in 
    import h5py
  File "C:\PROGRA~1/QGIS33~2.3/apps/qgis/./python\qgis\utils.py", line 923, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\threedi_results_analysis\deps\h5py\__init__.py", line 25, in 
    from . import _errors
ImportError: cannot import name '_errors' from partially initialized module 'h5py' (most likely due to a circular import) (C:\Users\leendert.vanwolfswin\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\threedi_results_analysis\deps\h5py\__init__.py)

@hoanphungt
Copy link
Contributor Author

@leendertvanwolfswinkel
It probably because of the version of h5py and scipy that are not supported for python 3.12 yet. For me, I didn't have this issue since it automatically downloads a version that has support for python 3.12. I made a new commit to update these 2 packages. Could you please try to test again?

dependencies.py Outdated Show resolved Hide resolved
Copy link
Contributor

@benvanbasten-ns benvanbasten-ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a prototype it seems fine, but it needs to be tested on windows, I guess.

@hoanphungt hoanphungt merged commit 1139f9e into master Dec 10, 2024
1 check passed
@hoanphungt hoanphungt deleted the hoan-update branch December 10, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants