Closed edurand closed 5 years ago
OK, this is not a nb_conda_kernels bug, I'm going to close the issue. However, for future reference, here's what happened:
After further investigation, the error is thrown in runner.py by
os.execvpe(command, (command,) + args, env)
The offending key, value in env is
'BASH_FUNC_module()': '() { eval `/usr/bin/modulecmd bash $*`'
Obviously the function definition lacks a closing bracket. Looking at the output of printenv:
$printenv
...
BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*`
}
_=/usr/bin/printenv
The function is defined over two lines which causes it to be "incorrectly" parsed in runner.py. I fixed it by downgrading to 2.1.0. Better solution would be to upgrade red hat...
I'm going to leave this open, because frankly it suggests we should be doing a better job of obtaining the environment.
Why not simply call os.environ
? It gives you a dict already - no need for manual parsing. In my case, the BASH_FUNC_module()
is correctly parsed by os.environ
.
We need the environment after it is possibly modified by the subprocess.
OK, would replacing the printenv
function by a Python script calling os.environ
and serialising (json?) its output to stdout achieve the desired effect?
That may be necessary but I'd prefer to avoid the extra process. (The shell has to happen regardless in order to source any post-activate scripts.)
What am I saying, env
is a process!
I could put together a PR if you'd like
On Fri, Mar 22, 2019 at 6:13 PM Michael C. Grant notifications@github.com wrote:
What am I saying, env is a process!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Anaconda-Platform/nb_conda_kernels/issues/134#issuecomment-475703835, or mute the thread https://github.com/notifications/unsubscribe-auth/ABI7KidJPBcAJRQcqBHgmkG3k-2gjsdgks5vZQ9EgaJpZM4b8boT .
Hey, that's great! But I'm working on one now. I'll tag you on the PR for review.
Hello,
My setup is as follow: I have a conda environment where I installed Jupyter and nb_conda_kernels, and other conda environments where I installed ipykernel (among other things).
I am running into the following error: when starting the Jupyter environment Python kernel, all is fine. However, when starting a kernel from another conda environment, I get the following error message:
Any idea what's going on? I'm out of ideas. Thanks!