BUG: Import fails due to misconfigured setup.py
bzah opened this issue · 3 comments
Code Sample, a minimal, complete, and verifiable piece of code
MRE:
From a fresh environment
conda install satpy
- open a python terminal
import satpy
- Get a error (see traceback below)
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
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:
- 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?
- Would you be willing to make a pull request with the necessary updates to fix this?
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.
$ python --version
Python 3.9.13
$ conda --version
conda 22.11.1
Yep, I can open a PR to fix that.