jupyterhub Docker 设置登陆账户

Published on Aug. 22, 2023, 12:07 p.m.

2021-07-02 记事

docker exec -it jupyterhub bash然后passwd root设置root的密码。

之后,您可以使用root上面设置的用户名和密码登录。

但是,root 管理员总是返回“Spawn failed”错误。

只有在 docker 容器中创建的普通用户才能成功生成。

https://jupyterhub.readthedocs.io/en/stable/quickstart-docker.html

https://github.com/jupyterhub/jupyterhub/issues/2989

要安装 conda-pack,请确保您位于 root 或 base 环境中,以便 conda-pack 在子环境中可用。Conda-pack 可通过 conda-forge 或者 PyPI 安装。

conda-forge:
bash conda install -c conda-forge conda-pack
PyPI:
bash pip install conda-pack
打包一个环境:

<h1>Pack environment my_env into my_env.tar.gz</h1>
conda pack -n my_env
<h1>Pack environment my_env into out_name.tar.gz</h1>
conda pack -n my_env -o out_name.tar.gz
<h1>Pack environment located at an explicit path into my_env.tar.gz</h1>
conda pack -p /explicit/path/to/my_env

<ul>
<li><code>bash
conda pack -n clearhtml37 -o clearhtml37.tar.gz
conda activate clearhtml37</code></li>
</ul>
<p><strong>重现环境:</strong></p>
<p>bash</p> <h1>Unpack environment into directory <code>my_env</code></h1> mkdir -p my_env tar -xzf my_env.tar.gz -C my_env <h1>Use Python without activating or fixing the prefixes. Most Python</h1> <h1>libraries will work fine, but things that require prefix cleanups</h1> <h1>will fail.</h1> ./my_env/bin/python <h1>Activate the environment. This adds <code>my_env/bin</code> to your path</h1> source my_env/bin/activate <h1>Run Python from in the environment</h1> (my_env) $ python <h1>Cleanup prefixes from in the active environment.</h1> <h1>Note that this command can also be run without activating the environment</h1> <h1>as long as some version of Python is already installed on the machine.</h1> (my_env) $ conda-unpack

Tags: