Conversation
that being the parent of lib/python3.XX/site-packages (set by the soconda module)
Member
|
Thanks @jsyleung , I agree with the underscore typo. I did not notice that since I have been using a custom kernel file pointing to a cloned environment. The change to For the PATH modifications, again this was because within the jupyter environment (at least at NERSC), the executables installed into our conda environment were not found (for example, from inside a jupyter terminal). However I can re-test that as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #32 and #33
@Bai-Chiang pointed out here that PYTHONUSERBASE is preferred for being able to process
*.pthfiles, while PYTHONPATH will not. Although they ultimately point to the same place, their declarations are not the same; PYTHONUSERBASE is intended to be the parent directory oflib/pythonX.Y/site-packages(default is~/.local), whereas PYTHONPATH requires the full path tosite-packages.The current soconda module (v0.6.16 on Tiger3) sets
PYTHONUSERBASE = $HOME/.local/soconda_v0.X.Y. Note in particular the'_'rather than the'/'prior to this commit. I believe this is from before we switched to the v0.X.Y naming scheme. For example, soconda_2025019 had$HOME/.local/soconda_20250109/3.10, which uses the'/'. It’s also possible that'/'is how it’s set up on NERSC—please check this withmodule show soconda.I tested the following on Tiger3-vis with soconda v0.6.11, v0.6.15, and v0.6.16 using VS Code (1.109.3) and Jupyter extension (2025.9.1).
Prior to change
Running
sys.pathreturnsThe user site-packages is not prepended because the
'/'makes it look forsoconda/v0.6.16rather thansoconda_v0.6.16.Change
'/'to'_'Again running
sys.path,The prepending worked, but as expected, the packages inside
*.pthfiles are missing (namely,sotodlib).With
PYTHONUSERBASE(this commit)Output of
sys.pathThis time
sotodlibappears! (since I installed it as a*.pth) Note that, when using PYTHONUSERBASE, Python will always place the user site-packages ahead of the environments. You can verify this in Python’ssite.pymodule:main()callsaddusersitepackages()beforeaddsitepackages().One more question
What’s the reason for changing PATH? Loading soconda in terminal doesn’t require it, and it seems risky to replace the original PATH, which includes system libraries etc. I tested removing it and nothing seems to have changed, but perhaps I missed something?