-
Notifications
You must be signed in to change notification settings - Fork 3k
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
New conda environment issue with another username #1792
Comments
Can you use |
@Bidek56 I guess the problem here is that |
@mathbunnyru , Yes, I'd do it, but first ipykernel install must be successful for all users, and it's only done for jovyan. How should I solve this? |
@masip85 I understand this, my message was addressed to @Bidek56. I don't know a good solution for your issue, but I might have a hack that might work (I haven't tested it). It's a bit ugly, because you will have all the config files in your mounted folder. |
And ipykernel installation?
El El lun, 3 oct 2022 a las 19:05, Ayaz Salikhov ***@***.***>
escribió:
… @masip85 <https://github.com/masip85> I understand this, my message was
addressed to @Bidek56 <https://github.com/Bidek56>.
I don't know a good solution for your issue, but I might have a hack that
might work (I haven't tested it).
Could you maybe mount /home/vicente folder, instead of the work folder
and then put .bashrc in this folder with the activate line.
It's a bit ugly, because you will have all the config files in your
mounted folder.
Also, I highly recommend making a backup, before testing, just in case.
—
Reply to this email directly, view it on GitHub
<#1792 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCES3WLFWFZHKTZ52MYGSTWBMG53ANCNFSM6AAAAAAQY2AN64>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I don't know the answer yet, sorry :( |
This is a solution, not a perfect one, but the best one by now:
Now we could find a cleaner way for this: I don't understand why .bashrc is not functional as the doc says.This should copy it to my user:
|
I am also having this issue in a gpu-jupyter install. The cuda environment doesn't transfer over cleanly to the new user. |
@njacobson-nci You may be interested in the CUDA-enabled JupyterLab Python docker stack, then:
|
@benz0li |
@njacobson-nci Follow-up to iot-salzburg/gpu-jupyter#108 (comment). Using one of my images and after
|
@masip85 I merged the fix. Sorry for making you wait a year. |
What docker image(s) are you using?
scipy-notebook
OS system and architecture running docker image
aarch64
What Docker command are you running?
docker run -it --name myproject --rm
-p 8888:8888
--user root
-e NB_USER=vicente
-e NB_UID="$(id -u)"
-e NB_GID="$(id -g)"
-e CHOWN_HOME=yes
-e CHOWN_HOME_OPTS="-R"
-w "/home/${NB_USER}"
-v "${PWD}"/test:/home/vicente/work
jupyter/myproject-notebook
How to Reproduce the problem?
Create Dockerfile with conda environment following doc:
https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#add-a-custom-conda-environment-and-jupyter-kernel
adding at the end the commented line:
RUN echo "conda activate ${conda_env}" >> "${HOME}/.bashrc"
Execute docker run with new NB_USER.
Command output
No response
Expected behavior
I want my user has the conda environments in the list of kernels from the beginning (as is documented, but for any other user)
Actual behavior
and
RUN echo "conda activate ${conda_env}" >> "${HOME}/.bashrc"
,in its context is executed only for jovyan home. So I guess is only being executed when jovyan starts a session. When my notebook starts with my user, if I open the terminal I only get default conda environment at the jupyter kernelspec list.
the And I dont want to use jovyan.
Anything else?
I can't use install without --user for install kernel it system wide:
RUN "${CONDA_DIR}/envs/${conda_env}/bin/python" -m ipykernel install --name="${conda_env}" && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}"
[Errno 13] Permission denied: '/usr/local/share/jupyter'
And in that case, I would have to hardcode this in dockerfile,
RUN echo "conda activate ${conda_env}" >> "/home/vicente/.bashrc"
which is not very pleasant. If you could solve the first issue, I'd like to get a nice way for doing the second one.
If the solution is not easy,maybe the best way is to giveup to conda environments, and always overwrite default conda environment with custom conda yaml or whatever. But in any of these cases,(if I am right) everything should be documented.
The text was updated successfully, but these errors were encountered: