Translations:JupyterNotebook/5/en: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Importing a new version from external source)
(Importing a new version from external source)
Line 1: Line 1:
Load the Python module:
#Load the Python module:
{{Command|module load python/3.5.2}}
#:{{Command|module load python/3.5.2}}
Create a new Python virtual environment:
#Create a new Python virtual environment:
{{Command|virtualenv $HOME/jupyter_py3}}
#:{{Command|virtualenv $HOME/jupyter_py3}}
#Activate your newly created Python virtual environment:
#:{{Command|source $HOME/jupyter_py3/bin/activate}}
#Install Jupyter into your virtual environment:
#:{{Command
|prompt=(jupyter_py3)[name@server $]
|pip install jupyter}}
#In your virtual environment, create a wrapper script that launches Jupyter notebook
#:{{Command
|prompt=(jupyter_py3)[name@server $]
|echo -e '#!/bin/bash\nunset XDG_RUNTIME_DIR\njupyter notebook --ip $(hostname -f) --no-browser' > $VIRTUAL_ENV/bin/notebook.sh
}}
#Finally, make the script executable
#:{{Command
|prompt=(jupyter_py3)[name@server $]
|chmod u+x $VIRTUAL_ENV/bin/notebook.sh
}}

Revision as of 19:54, 12 October 2017

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (JupyterNotebook)
<ol>
<li>Load the Python module.
{{Command2|module load python/3.7}}
<li>Create a new Python virtual environment.
{{Command2|virtualenv $HOME/jupyter_py3}}
<li>Activate your newly created Python virtual environment.
{{Command2|source $HOME/jupyter_py3/bin/activate}}
<li>Install Jupyter Notebook in your new virtual environment.
{{Commands2
|prompt=(jupyter_py3) [name@server ~]$
|pip install --no-index --upgrade pip
|pip install --no-index jupyter
}}
<li>In the virtual environment, create a wrapper script that launches Jupyter Notebook. 
{{Command2
|prompt=(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
}}
<li>Finally, make the script executable.
{{Command2
|prompt=(jupyter_py3)_[name@server ~]$
|chmod u+x $VIRTUAL_ENV/bin/notebook.sh
}}
</ol>
  1. Load the Python module:
    Question.png
    [name@server ~]$ module load python/3.5.2
    
  2. Create a new Python virtual environment:
    Question.png
    [name@server ~]$ virtualenv $HOME/jupyter_py3
    
  3. Activate your newly created Python virtual environment:
    Question.png
    [name@server ~]$ source $HOME/jupyter_py3/bin/activate
    
  4. Install Jupyter into your virtual environment:
    Question.png
    (jupyter_py3)[name@server $] pip install jupyter
    
  5. In your virtual environment, create a wrapper script that launches Jupyter notebook
    Question.png
    (jupyter_py3)[name@server $] echo -e '#!/bin/bash\nunset XDG_RUNTIME_DIR\njupyter notebook --ip $(hostname -f) --no-browser' > $VIRTUAL_ENV/bin/notebook.sh
    
  6. Finally, make the script executable
    Question.png
    (jupyter_py3)[name@server $] chmod u+x $VIRTUAL_ENV/bin/notebook.sh