Translations:JupyterNotebook/5/en: Difference between revisions
(Importing a new version from external source) |
(Importing a new version from external source) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
{{Command2|source $HOME/jupyter_py3/bin/activate}} | {{Command2|source $HOME/jupyter_py3/bin/activate}} | ||
<li>Install Jupyter Notebook in your new virtual environment. | <li>Install Jupyter Notebook in your new virtual environment. | ||
{{ | {{Commands2 | ||
|prompt=(jupyter_py3) | |prompt=(jupyter_py3) [name@server ~]$ | ||
|pip install jupyter}} | |pip install --no-index --upgrade pip | ||
|pip install --no-index jupyter | |||
}} | |||
<li>In the virtual environment, create a wrapper script that launches Jupyter Notebook. | <li>In the virtual environment, create a wrapper script that launches Jupyter Notebook. | ||
{{Command2 | {{Command2 | ||
|prompt=(jupyter_py3)_[name@server ~]$ | |prompt=(jupyter_py3)_[name@server ~]$ | ||
|echo -e '#!/bin/bash\ | |echo -e '#!/bin/bash\nexport JUPYTER_RUNTIME_DIR{{=}}$SLURM_TMPDIR/jupyter\njupyter notebook --ip $(hostname -f) --no-browser' > $VIRTUAL_ENV/bin/notebook.sh | ||
}} | }} | ||
<li>Finally, make the script executable. | <li>Finally, make the script executable. |
Latest revision as of 16:20, 24 October 2023
- Load the Python module.
[name@server ~]$ module load python/3.7
- Create a new Python virtual environment.
[name@server ~]$ virtualenv $HOME/jupyter_py3
- Activate your newly created Python virtual environment.
[name@server ~]$ source $HOME/jupyter_py3/bin/activate
- Install Jupyter Notebook in your new virtual environment.
(jupyter_py3) [name@server ~]$ pip install --no-index --upgrade pip (jupyter_py3) [name@server ~]$ pip install --no-index jupyter
- In the virtual environment, create a wrapper script that launches Jupyter Notebook.
(jupyter_py3)_[name@server ~]$ echo -e '#!/bin/bash\nexport JUPYTER_RUNTIME_DIR=$SLURM_TMPDIR/jupyter\njupyter notebook --ip $(hostname -f) --no-browser' > $VIRTUAL_ENV/bin/notebook.sh
- Finally, make the script executable.
(jupyter_py3)_[name@server ~]$ chmod u+x $VIRTUAL_ENV/bin/notebook.sh