tsutterley / pyTMD

Python-based tidal prediction software
https://pytmd.readthedocs.io
MIT License
117 stars 38 forks source link

Inconsistency between GDAL and PROJ dependencies #89

Open JoaoLopez opened 2 years ago

JoaoLopez commented 2 years ago

Hi,

I am trying to install pyTMD by the source code on a conda environment, but I am having some problems with the dependencies of the project.

First, I created a new conda environment, ran conda install python=3.8.12 (to install Python 3.8), and executed python setup.py install. The last command caused the following error: [Errno 2] No such file or directory: \'gdal-config\'\n\nCould not find gdal-config. Make sure you have installed the GDAL native library and development headers.').

I assumed this problem occurred because I had not installed GDAL on the conda environment yet. So, I ran conda install gdal and then executed python setup.py install again. This time, I have gotten the error:

Running Cartopy-0.20.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-368fd3wt/Cartopy-0.20.2/egg-dist-tmp-obj9zsyp Proj version 6.2.1 is installed, but cartopy requires at least version 8.0.0. error: Setup script exited with 1

In order to install the correct version of proj, I ran conda search proj and found out that the only available versions greater than 8.0.0 are 8.0.1 and 8.2.1. But, when I try to install PROJ with one of those versions (using conda install proj=8.0.1, for example) I allways get an inconsistency between proj and gdal.

I have tried to solve this problem in many ways but I have not been successful.

I know I can try to install pyTMD using conda-forge but, due to the way I want to use the project, it would be much better if I could install it from the source code.

Thank you very much in advance for all your help!

tsutterley commented 2 years ago

Hi @JoaoLopez, this is a really good thing to bring up. I thought you could simply build a working conda environment using the supplied environment.yml file. Seems like that's not working. I have GDAL and PROJ installed from source (which I don't recommend as it can be quite the pain). I'll change setup.py to pop GDAL from the requirements list if gdal-config can't be found. I'll also remove cartopy and matplotlib from the list of requirements (but keep them in environment.yml) as they are only used in the Jupyter notebooks (and so technically aren't required). Hope this helps fix your problem. Let me know!

I've also been thinking about reworking the Jupyter notebooks to drop the cartopy dependency and replace the static maps with interactive leaflet maps. That could enable some other cool things too :)

JoaoLopez commented 2 years ago

Thank you very much, @tsutterley! This time, the installation process runned without any errors.

I am a graduation student in Computer Science and I would like to try to speed up pyTMD execution using cache. The problem I am facing now is how to run pyTMD with the data I found in two DataOne projects (https://search.dataone.org/view/doi%3A10.18739%2FA2251FM3S#urn%3Auuid%3A552d6454-dc55-4ce2-8b54-7b53b71bd5a5 and https://search.dataone.org/view/doi%3A10.18739%2FA2PV6B79W).

Since I am not from this field I am having a lot of trouble with the terminology used. I would be very grateful for any help you could give me. Thank you very much in advance!

tsutterley commented 2 years ago

Hi @JoaoLopez, Sorry for the long delay. You should be able to download the data from the Arctic Data Center with arcticdata_tides.py. That would set the directories how pyTMD would prefer. Hopefully then you'd just have to set the model to Gr1kmTM. I tried to make things work as simply as possible (while still supporting a variety of different tide model types). A lot of detail on directories is written in the "Getting Started" page. I'd gladly accept any help making pyTMD easier and faster to use. Details on contributing are listed in the guidelines. If you have any specific questions let me know :)

tsutterley commented 1 year ago

Another comment, I just switched the CI build to use mamba. It was super fast to build the environment. Might help here.