-
Notifications
You must be signed in to change notification settings - Fork 16
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
Do not export unnecessary conda env vars, use conda run #232
Conversation
Tests pass when run locally except for the error |
I wonder if this coo_matrix is due to some recent change with caiman. |
Because we didn't have it before. |
mesmerize_core/utils.py
Outdated
if "CONDA_PREFIX" in os.environ.keys(): | ||
# add command to run the python script in the conda environment loaded | ||
# at the time that this shell script was generated | ||
f.write(f'conda run -p {os.environ["CONDA_PREFIX"]} python {module_path} {args_str}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would assume that conda is findable in the shell env that that is launched by the subprocess and I don't think that's going to be the case if the conda binary isn't in the PATH env variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "conda run" the best way to do this? If so then the fully path to the conda executable should be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative is to activate the conda environment and then run python, but conda activate
within a shell script can be tricky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with conda run
if "CONDA_PREFIX" in os.environ.keys(): | ||
f.write( | ||
f'export CONDA_PREFIX={os.environ["CONDA_PREFIX"]}\n' | ||
f'export CONDA_PYTHON_EXE={os.environ["CONDA_PYTHON_EXE"]}\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this is no longer necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the CONDA_PYTHON_EXE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these env variables will not do anything if the conda environment is not activated and you call the default python
below.
This works locally on my Mac M1 system.
relevant env vars without any conda env activated are:
|
This is working for me (on Linux). |
Fix #230