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

macOS installation problem: installing the plugin starts a new QGIS instance #804

Closed
janzandr opened this issue Feb 12, 2024 · 13 comments
Closed
Assignees
Labels
bug Something isn't working workaround Known issue, but a workaround exists
Milestone

Comments

@janzandr
Copy link
Contributor

janzandr commented Feb 12, 2024

Reported by Mariana Altenburg Soppa via email.

Installation was done via mamba:

$ mamba env create -n enpt_full -f https://git.gfz-potsdam.de/EnMAP/GFZ_Tools_EnMAP_BOX/EnPT/raw/main/tests/gitlab_CI_docker/context/environment_enpt_full.yml

Versions:

  • QGIS 3.34.3-Prizren

  • EnMAP-Box version 3
    "I cannot select (check the Box) of EnMAP-Box in QGIS Plugin manager. I could uninstall, but the installation never get completed and a new QGIS starts."

importing enpt package also shows a ValueError:

import enpt
Traceback (most recent call last):
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/enpt/__init__.py", line 37, in <module>
    from .execution.controller import EnPT_Controller
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/enpt/execution/controller.py", line 46, in <module>
    from ..io.reader import L1B_Reader
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/enpt/io/reader.py", line 36, in <module>
    from scipy.interpolate import interp1d
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/scipy/__init__.py", line 67, in <module>
    from scipy._lib import _pep440
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/scipy/_lib/__init__.py", line 12, in <module>
    from scipy._lib._testutils import PytestTester
  File "/Users/msoppa/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 38, in __wrapping_ee_import__
    _module_ = __builtin_import__(name, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/share/qgis/python/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/scipy/_lib/_testutils.py", line 21, in <module>
    _tags = list(sys_tags())
            ^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/packaging/tags.py", line 543, in sys_tags
    yield from cpython_tags(warn=warn)
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/packaging/tags.py", line 212, in cpython_tags
    platforms = list(platforms or platform_tags())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/msoppa/mambaforge/envs/enpt_full_Feb24/lib/python3.11/site-packages/packaging/tags.py", line 412, in mac_platforms
    version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

@janzandr
Copy link
Contributor Author

@danschef please have a look at what could cause the ValueError, when importing enpt under macOS.

@jakimowb can you please have a look at the installation problem. The problem sounds familiar. We had a similar problem in the past, where the installation starts new QGIS instances.

@janzandr janzandr added the bug Something isn't working label Feb 12, 2024
@danschef
Copy link
Contributor

danschef commented Feb 13, 2024

According to the above traceback, the ValueError is raised when EnPT tries to import from scipy.interpolate import interp1d and within there, at from scipy._lib._testutils import PytestTester. I just installed the latest scipy (v1.12.0) on Linux - both imports are working properly. However, I don´t have a Mac, so I cannot try it there. @jakimowb Could you maybe try this on a Mac?

@msoppa1 Could you check which version of scipy is installed on your machine (conda list scipy). You could try to downgrade scipy by running conda install "scipy<1.12.0". If that helps, I could easily add a version pinning to EnPT to make it work for now.

However, since interp1d does not receive updates anymore, I need to replace it in EnPT anyway. I will look into this as soon as possible.

@msoppa1
Copy link

msoppa1 commented Feb 14, 2024 via email

@danschef
Copy link
Contributor

So which version of scipy is now installed?

The above traceback from EnPT contains some lines of code which are not at the current version. For example, I recently revised the package sensormapgeo, it should now be at version 1.0.0 but the code called above is older. Also, it looks like you are using an old version of GDAL (3.5.*, the latest version of EnPT needs 3.8) and there might probably be something wrong with your environment because somehow there seems to be a link to /usr/local/Cellar/gdal/3.5.2/bin/gdalwarp which is not loaded from your environment (/Users/msoppa/mambaforge/envs/enpt_full_Feb24/) at all.

How did you install EnPT? I would strongly recommend to setup the environment from scratch and not update an existing environment. Also make sure conda is up-to-date (mamba update -n base --all) before creating the environment.

@danschef
Copy link
Contributor

Note that the update of sensormapgeo was last week, so maybe re-creating the environment already fixes it. It should install enpt 0.20.0, enpt_enmapboxapp 0.8.5, sensormapgeo 1.0.0, arosics 1.10.2, gdal 3.8.*, and python 3.11.

@msoppa1
Copy link

msoppa1 commented Feb 14, 2024 via email

@jakimowb
Copy link
Contributor

jakimowb commented Feb 22, 2024

According to the above traceback, the ValueError is raised when EnPT tries to import from scipy.interpolate import interp1d and within there, at from scipy._lib._testutils import PytestTester.

@danschef indeed, from scipy.interpolate import interp1d causes QGIS to restart if installed with conda on macOS.
This also happens in a clean conda environment with QGIS + scipy only (no other QGIS plugins).

@danschef
Copy link
Contributor

Then I will just add an upper-version pinning for scipy for now and replace interp1d in the next release.

@jakimowb
Copy link
Contributor

relates to conda-forge/qgis-feedstock#405

@jakimowb
Copy link
Contributor

jakimowb commented Feb 22, 2024

A workaround until conda-forge/qgis-feedstock#405 is closed can be to
ensure that the scipy version is < 1.12:

conda install "scipy<1.12"

@msoppa1 please let me know if this helped in your case

@jakimowb jakimowb added bug Something isn't working workaround Known issue, but a workaround exists and removed bug Something isn't working labels Feb 22, 2024
jakimowb added a commit that referenced this issue Feb 22, 2024
@jakimowb
Copy link
Contributor

workaround provided with #814

@msoppa1
Copy link

msoppa1 commented Mar 4, 2024 via email

@danschef
Copy link
Contributor

danschef commented Mar 5, 2024

EnPT v0.20.1 (just released) replaces scipy.interpolate.interp1d. A GUI update (enpt_enmapboxapp) will be released soon. This should hopefully fix the EnPT-related part of this issue.

@janzandr janzandr added this to the 3.14.0 milestone Jul 3, 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 workaround Known issue, but a workaround exists
Projects
None yet
Development

No branches or pull requests

4 participants