NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
478 stars 168 forks source link

conda install much easier (or only possible) without premature python install #382

Closed michaelaye closed 1 year ago

michaelaye commented 1 year ago

The current conda installation instructions say that one should do:

conda env create -n asp python=3.6

But this creates unresolvable obstacles during the dependency solving in the next step (don't ask me why, but it's something to do with that conda and mamba work much better when they get all the dependencies in one step).

The ISIS team has also realized that and changed their instructions to do this:

conda create -n isis

and the required python version simply comes in later when installing the meta-package isis or stereo-pipeline.

So, I'd recommend to change the instructions to that here as well:

conda create -n asp
conda activate asp
conda config --env --add channels usgs-astrogeology
conda config --env --add channels nasa-ames-stereo-pipeline

Note that the defaults channel isn't required to resolve your dependencies, and I had no issues installing everything using mamba either.

michaelaye commented 1 year ago

Note that this statement is not true:

We do not recommend using the --prepend channels argument, as that will add the nasa-ames-stereo-pipeline to your default ~/.condarc file and will have consequences for all of your conda environments, which you don't want.

--prepend works in whatever env I have the conda config instructed to work in. So, if I do:

conda config --env --prepend nasa-ames-stereo-pipeline

conda will simply put the nasa ames channel as the top most in the current environment. As the instructions at this point have already activated the asp env, a --env --prepend would not change all other envs of the conda setup.

oleg-alexandrov commented 1 year ago

Thank you for noticing these. I never had a problem installing as our doc was saying, but given that the ISIS folks switched to doing it that way, it makes sense to follow them. I verified that "conda create -n asp" (so without setting the python version) works, and I will update the doc in a short time.

Aso to the "--prepend" option, I will let Ross comment. There's no harm with the current text, I guess.

rbeyer commented 1 year ago

Well, as Michael points out, the statement we have isn't globally true, it doesn't always write to the over-arching ~/.condarc file. I suspect that only happens if you haven't activated an environment. If you have, then it works as expected, and desired.

Our paragraph about --prepend is a warning. Our instructions never tell a user to use --prepend but this is clearly here because someone tried to at some point and things got screwed up.

We can either (1) delete the paragraph entirely (because patterns around channel loading may be fluid enough that we shouldn't give advice when people should really go and look up and understand what conda commands they're issuing). (2) Or we could modify the para to say that if a user is contemplating using conda config --prepend that they ensure that they are either already in a loaded conda environment or make sure to also use the --env command to specify a specific environment that is not loaded.

oleg-alexandrov commented 1 year ago

Ross, you can edit that text as you see fit, I think you added it to start with.

rbeyer commented 1 year ago

Can't say I remember that, but that's not surprising. I'll take care of it.

oleg-alexandrov commented 1 year ago

Could have been Scott then. I remember vaguely only that at some point you made some additions around that area but I can't say for sure what was put in.

michaelaye commented 1 year ago

(2) Or we could modify the para to say that if a user is contemplating using conda config --prepend that they ensure that they are either already in a loaded conda environment

Just to be clear (maybe this was a typo?), but conda config --prepend does indeed change the global config ALWAYS! Only conda config --env --prepend respects the currently activated env.

rbeyer commented 1 year ago

The instructions have now changed to remove the explicit python=3.6 statement as the OP asked for, and the language around the use of the --prepend argument has also been updated.