desihub / desimodules

Maintain the default set of DESI product versions and environment modules loaded.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

desi-conda modules overwrite existing PYTHONPATH #6

Closed weaverba137 closed 7 years ago

weaverba137 commented 7 years ago

The desi-conda Module files overwrite any existing PYTHONPATH definitions. Paths should always set with prepend-path, not setenv.

tskisner commented 7 years ago

This is absolutely intentional and is required in order to avoid searching directories that NERSC places in PYTHONPATH. We are loading a full new python stack with this module and hence we reset the search path.

On Oct 12, 2016 4:02 PM, "Benjamin Alan Weaver" notifications@github.com wrote:

Assigned #6 https://github.com/desihub/desimodules/issues/6 to @tskisner https://github.com/tskisner.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/desihub/desimodules/issues/6#event-821727995, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFI_Rh0IfmmGkU6-owQe1KBWjgSwhLGks5qzWcHgaJpZM4KVT-R .

weaverba137 commented 7 years ago

OK, I guess I can understand that, but it is annoying in certain circumstances. I think this should be documented somewhere.

tskisner commented 7 years ago

It is true that unloading the module would then not restore NERSC's default python path. However, that is not a typical pattern. Swapping to a different desi-conda version would just reset it to the new value. It probably would be technically possible to save the old PYTHONPATH to some other variable if mode == load, and then restore it if mode == swap or unload. However, I think that would just be an academic exercise in TCL / modulefile manipulation. Getting cleanly back to the default NERSC / Cray environment probably requires a fresh login.

weaverba137 commented 7 years ago

I've added a short note about this to https://desi.lbl.gov/trac/wiki/Pipeline/GettingStarted/NERSC#GuidefortheImpatient, which I think is sufficient.