Skip to content

Copernicus (CMEMS) tools and functions fail with RuntimeError: Failed to query the Copernicus Marine Service catalogue for dataset ID "XXXXX". The copernicusmarine.describe() function failed with RuntimeError: no running event loop. #1

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

Closed
jjrob opened this issue Sep 19, 2024 · 2 comments
Labels
bug Something isn't working external The problem originates from an external library or dependency

Comments

@jjrob
Copy link
Owner

jjrob commented Sep 19, 2024

This problem occurs because of a change to the Python aiohttp package that affected the copernicusmarine package. See aio-libs/aiohttp#8555 for detail of the change to aiohttp.

The problem occurs when the installed version of aiohttp is 3.10.0 or newer but the installed version of copernicusmarine 1.3.0 or older. This scenario tends to happen for MGET users who have ArcGIS Pro 3.2.x, due to the following situation:

  • ArcGIS Pro 3.2.x pins the version of the numpy package to 1.22
  • copernicusmarine depends on both numpy and aiohttp
  • copernicusmarine cannot be updated beyond 1.3.0 unless numpy is upgraded beyond 1.22
  • copernicusmarine does not limit what version of aiohttp can be installed, therefore version 3.10.0 or later will likely be installed unless the user explicitly prevents it
  • aiohttp 3.10.0 made a change that broke copernicusmarine 1.3.0
  • copernicusmarine fixed this problem in a later release, but can't be upgraded because numpy also be upgraded, because of ArcGIS Pro 3.2.x pinning it to verison 1.22
@jjrob jjrob added the bug Something isn't working label Sep 19, 2024
@jjrob
Copy link
Owner Author

jjrob commented Sep 19, 2024

We can't solve this from within MGET itself. Assuming you are stuck with copernicusmarine 1.3.0 because of ArcGIS pinning numpy, or some similar reason, the solution we recommend is to downgrade aiohttp to version 3.9.5.

First confirm that conflicting versions of the packages are installed. From the ArcGIS Python Command Prompt, run:

conda list "aiohttp|copernicusmarine"

You should see output similar to:

# packages in environment at C:\Users\Jason\AppData\Local\ESRI\conda\envs\arcgispro-py3-mget:
#
# Name                    Version                   Build  Channel
aiohttp                   3.10.5                   pypi_0    pypi
copernicusmarine          1.3.0                    pypi_0    pypi

If you have aiohttp >= 3.10.0 and copernicusmarine <= 1.3.0, then you have the conflicting packages. The solution is to downgrade aiohttp to version 3.9.5. From the same Python Command Prompt, run:

conda install --no-deps conda-forge::aiohttp==3.9.5

The --no-deps flag should prevent conda from updating any other packages. Be warned that if any other packages require 3.10 or later, they may be broken.

Also, the conda dependency solver that came with ArcGIS Pro 3.2.x is very slow. If you find that this command seems to run forever with the message Solving environment, you can try running the command with micromamba instead of conda.

@jjrob jjrob added the external The problem originates from an external library or dependency label Sep 19, 2024
@jjrob
Copy link
Owner Author

jjrob commented Sep 19, 2024

Closing this as external.

@jjrob jjrob closed this as completed Sep 19, 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 external The problem originates from an external library or dependency
Projects
None yet
Development

No branches or pull requests

1 participant