pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
346 stars 94 forks source link

BUG: Import fails due to misconfigured setup.py #486

Closed bzah closed 1 year ago

bzah commented 1 year ago

Code Sample, a minimal, complete, and verifiable piece of code

MRE: From a fresh environment

Problem description

[this should also explain why the current behaviour is a problem and why the expected output is a better solution.]

When installing satpy from a fresh environment, the version of pyproj that get installed is '2.6.1.post1'. However, pyresample requires the pyproj.aoi module that was introduced in pyproj 3.0.0.

This can probably be fixed by updating setup.py of pyresample project to 'pyproj>=3.0.0' instead of 'pyproj>=2.2'

Note: I'm new to pytroll's ecosystem.

Expected Output

No error.

Actual Result, Traceback if applicable

import pyresample
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\aouna\Anaconda3\lib\site-packages\pyresample\__init__.py", line 25, in <module>
    from pyresample import geometry  # noqa
  File "C:\Users\aouna\Anaconda3\lib\site-packages\pyresample\geometry.py", line 33, in <module>
    from pyproj.aoi import AreaOfUse
ModuleNotFoundError: No module named 'pyproj.aoi'

Versions of Python, package at hand and relevant dependencies

python 3.9.13 satpy: 0.38

djhoese commented 1 year ago

Ah, nice catch. I agree the minimum version should probably be updated in the setup.py. Pyproj 3.0.0 came out in November of 2020 which I think is reasonable as a minimum version. @mraspaud @pnuu thoughts?

Some questions for you @bzah:

  1. What version of anaconda and python are you creating this environment for that it would attempt to install pyproj 2.6 instead of the newest version?
  2. Would you be willing to make a pull request with the necessary updates to fix this?
pnuu commented 1 year ago

I'm fine with requiring Pyproj 3. My guess is this is happening with Python 3.11, as there were also other weird versions I saw when I quickly tested it some time back.

bzah commented 1 year ago
$ python --version
Python 3.9.13

$ conda --version
conda 22.11.1

Yep, I can open a PR to fix that.