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

Possibly add python>=3.6 to docs/conda.txt #83

Closed
piyushrpt opened this issue Jun 8, 2019 · 11 comments
Closed

Possibly add python>=3.6 to docs/conda.txt #83

piyushrpt opened this issue Jun 8, 2019 · 11 comments
Assignees

Comments

@piyushrpt
Copy link
Contributor

This is related to #76

When combining multiple requirements.txt (conda.txt for MintPy) to use gdal 3.0 features with MintPy, conda's automatic resolution downgrades the python version to 2.7 to satisfy all the requirements. Adding python>=3.6 to conda.txt guarantees that a python3 environment is setup and that python doesnt get accidentally downgraded.

It would help to include this in the requirements file to allow for setup of environments where multiple tools can operate in the same env by just combining the requirements.txt files.

For reference adding these 3 lines to conda.txt allows us to interoperate with gdal3.0

gdal>=3.0
libgdal
python>=3.6
@yunjunz yunjunz self-assigned this Jun 8, 2019
@yunjunz yunjunz mentioned this issue Jun 8, 2019
@yunjunz
Copy link
Member

yunjunz commented Jun 8, 2019

Hi @piyushrpt, I have added the 3 lines you suggested to conda.txt. Thank you for the recommendation.

@piyushrpt
Copy link
Contributor Author

@yunjunz Thanks for the update

@piyushrpt
Copy link
Contributor Author

There exists a minor conflict in handling the PROJ_LIB environment variable by the different packages.

  • For GDAL3, this needs to point to PROJ v6 which is in share/proj. This is automatically done by conda.
  • For basemap to continue to work with older PROJ conventions, this needs to point to
export PROJ_LIB=`python3 -c "import pyproj; print(pyproj.pyproj_datadir)"`

For now one might have to toggle between the 2 settings for HDF5 preparation / visualization stages for #76

@yunjunz yunjunz mentioned this issue Jun 10, 2019
@yunjunz
Copy link
Member

yunjunz commented Jun 10, 2019

Thank you @piyushrpt for the suggestion, I have updated the installation note accordingly.

@hfattahi
Copy link
Collaborator

@yunjunz For now let's remove the "gdal>=3.0" from the https://github.com/insarlab/MintPy/blob/master/docs/conda.txt please and leave the issue open until basemap and GDAL3 are consistent (which shouldn't be long). This way we won't break mintpy (in particular basemap) for mintpy users. The solution @piyushrpt gave is clear enough for limited users of prep_aria.py at the moment.

@hfattahi hfattahi reopened this Jun 10, 2019
@yunjunz
Copy link
Member

yunjunz commented Jun 10, 2019

Hi @hfattahi, from a test installation using the current conda.txt with gdal>=3.0 and PROJ_LIB setup, basemap from MintPy works for me, as shown below.

I did not test prep_aria.py and thought toggle between the 2 settings meant for PROJ_LIB setup only, is it @piyushrpt ?

[yunjunz:~] yunjunz% conda list gdal
# packages in environment at /Users/yunjunz/development/python/miniconda3_test:
#
# Name                    Version                   Build  Channel
gdal                      3.0.0            py36h7eb7563_3    conda-forge
libgdal                   3.0.0                h1405c63_3    conda-forge

[yunjunz:~] yunjunz% smallbaselineApp.py -v
MintPy release version v1.1.2-28, release date 2019-06-09

[yunjunz:~] yunjunz% plot_coherence_matrix.py
usage: plot_coherence_matrix.py [-h] [--yx Y X] [--lalo LAT LON]
                                [--lookup LOOKUP_FILE] [-c COLORMAP]
                                [--figsize WID LEN] [--img-file IMG_FILE]
                                [--view-cmd VIEW_CMD] [--save] [--nodisplay]
                                [--noverbose]
                                ifgram_file
plot_coherence_matrix.py: error: the following arguments are required: ifgram_file

@piyushrpt
Copy link
Contributor Author

That's right. You need PROJ_LIB to point to the default proj6 (setup by activating conda env) for using prep_aria to generate HDF5. Once this is done, one needs to set PROJ_LIB with the command that points to pyproj data for using basemap. Hopefully, this discrepancy in basemap gets resolved soon. Just want to make sure that adding gdal3 is not forcing other users to change their behavior (since everything needed for prep_aria is not public yet).

@yunjunz
Copy link
Member

yunjunz commented Jun 10, 2019

PROJ_LIB problem has existed for a while now for basemap conda-forge/basemap-feedstock#30. It's caused by conda installation only, macports installation works fine. Adding gdal to conda.txt does not affect this problem.

Related with basemap, I gave a shot on replacing basemap with cartopy #87, but not very successful. Will look at it again in the future.

I do agree that gdal>=3.0 in conda.txt is a relative strong constraint, which might force other users to change their behavior, and other scripts in mintpy do not need it. I will remove it for now.

@yunjunz
Copy link
Member

yunjunz commented Jul 23, 2019

The basemap PROJ_LIB issue is fixed in the development version on Github (matplotlib/basemap#454). The latest release has not included this fix yet. For now, the following command works from my limited testing:

For macports:

# run "sudo port uninstall py36-matplotlib-basemap" if basemap was installed with port
sudo /opt/local/bin/pip install git+https://github.com/matplotlib/basemap.git#egg=mpl_toolkits

For conda:

# run "conda uninstall basemap" if basemap was installed with conda
$PYTHON3DIR/bin/pip install git+https://github.com/matplotlib/basemap.git#egg=mpl_toolkits

@Ovec8hkin
Copy link
Contributor

Can this be closed now that Basemap has been replaced by cartopy?

@yunjunz
Copy link
Member

yunjunz commented Feb 7, 2020

From my testing on macOS Mojave, I am able to install isce2, aria-tools, mintpy and pyaps all in one conda environment, with the note here: https://github.com/yunjunz/macOS_Setup/blob/master/README.md. Close this issue.

@yunjunz yunjunz closed this as completed Feb 7, 2020
yunjunz referenced this issue in yunjunz/macOS_setup Feb 7, 2020
This conda.txt install all dependencies required for isce2, mintpy, aria-tools and pyaps.

update README.md file for the setup in .bash_profile file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants