This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
other:python:starting [2019/06/17 07:15] jypeter Improved the intro |
other:python:starting [2022/08/11 09:37] jypeter [Anaconda] Updated |
||
---|---|---|---|
Line 30: | Line 30: | ||
</code> | </code> | ||
- | ===== Ultra quick-start on the LSCE servers ===== | + | ===== Ultra quick-start on the interactive LSCE servers ===== |
==== Initialization ==== | ==== Initialization ==== | ||
Line 123: | Line 123: | ||
- Learn Python by reading what you need on the [[other:python:jyp_steps|JYP's recommended steps for learning python]] page | - Learn Python by reading what you need on the [[other:python:jyp_steps|JYP's recommended steps for learning python]] page | ||
+ | |||
+ | ===== Using the LSCE jupyterhub server ===== | ||
+ | |||
+ | The [[https://intranet.lsce.ipsl.fr/informatique/en/jupyter/index.php|LSCE jupyterhub notebook server]] is available for users with a LSCE Linux account: | ||
+ | * from a computer on the LSCE wired network: https://jupyter.lsce.ipsl.fr/ | ||
+ | * from other computers: start the [[https://intranet.lsce.ipsl.fr/informatique/fr/vpn-forticlient.php#vpnlsce|LSCE VPN]] before opening https://jupyter.lsce.ipsl.fr/ | ||
+ | |||
+ | ==== Using a non-standard kernel ==== | ||
+ | |||
+ | Note: a //kernel// is a specific python environment/distribution | ||
+ | |||
+ | The LSCE jupyterhub server can be used to open //Notebooks// using pre-configured Python or R //kernels//. It is also possible to define additional per-user kernels by adding [[https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs|kernel configuration directories]] in the user's home directory | ||
+ | |||
+ | The steps below show how to add a specific [[other:python:starting#cdat|CDAT environment]] kernel, but can be easily adapted for using other kernels | ||
+ | |||
+ | - Initialize your (favorite) Python environment in a terminal, and (as usual) check which Python executable you are using\\ <code> >which python | ||
+ | /usr/bin/python | ||
+ | |||
+ | >source ~jypeter/.conda3_21-02_jyp.csh | ||
+ | >conda activate cdatm_py3 | ||
+ | |||
+ | (cdatm_py3) >which python | ||
+ | /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm_py3/bin/python</code> | ||
+ | - Determine where the kernel configuration files of the **active** python are located\\ <code> >jupyter kernelspec list | ||
+ | Available kernels: | ||
+ | python3 /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_nompi_py3/share/jupyter/kernels/python3</code> | ||
+ | - Copy the existing kernel directory that you have found to your home directory. You can use the existing kernel name, or use a new kernel name (using only ASCII letters, numbers, ''-'' hyphen, ''.'' period and ''_'' underscore)\\ <code> >cp -pr /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_nompi_py3/share/jupyter/kernels/python3 ~/.local/share/jupyter/kernels | ||
+ | >cp -pr /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_nompi_py3/share/jupyter/kernels/python3 ~/.local/share/jupyter/kernels/my_favorite_kernel | ||
+ | |||
+ | >ls ~/.local/share/jupyter/kernels/ | ||
+ | my_favorite_kernel/ python3/ | ||
+ | </code> | ||
+ | - Check that the ''kernelspec list'' command now finds the new kernel(s)\\ <code> >jupyter kernelspec list | ||
+ | Available kernels: | ||
+ | my_favorite_kernel your_home_dir/.local/share/jupyter/kernels/my_favorite_kernel | ||
+ | python3 your_home_dir/.local/share/jupyter/kernels/python3</code> | ||
+ | - You can optionally change the value of the ''display_name'' parameter in the ''kernel.json'' configuration file if you want to customize the name that will appear in the jupyterhub kernel menus\\ <code> >ls your_home_dir/.local/share/jupyter/kernels/my_favorite_kernel | ||
+ | kernel.json logo-32x32.png logo-64x64.png | ||
+ | |||
+ | >cat your_home_dir/.local/share/jupyter/kernels/my_favorite_kernel/kernel.json | ||
+ | { | ||
+ | "argv": [ | ||
+ | "/home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_nompi_py3/bin/python", | ||
+ | "-m", | ||
+ | "ipykernel_launcher", | ||
+ | "-f", | ||
+ | "{connection_file}" | ||
+ | ], | ||
+ | "display_name": "My favorite Python kernel", | ||
+ | "language": "python" | ||
+ | </code> | ||
+ | - refresh the https://jupyter.lsce.ipsl.fr/ page and the new kernel(s) should appear in the kernels' related menus | ||
===== Python distributions available for LSCE users ===== | ===== Python distributions available for LSCE users ===== | ||
Line 161: | Line 213: | ||
==== CDAT ==== | ==== CDAT ==== | ||
- | [[https://uvcdat.llnl.gov/|CDAT]] (//Community Data Analysis Tools//) is a powerful and complete front-end to a rich set of visual-data exploration and analysis capabilities well suited for **climate** data analysis problems, and is recommended by JYP. | + | [[https://cdat.llnl.gov/|CDAT]] (//Community Data Analysis Tools//) is a powerful and complete front-end to a rich set of visual-data exploration and analysis capabilities well suited for **climate** data analysis problems. CDAT is **recommended by JYP**. |
CDAT is **available for Mac, Linux and Windows 10 (Windows 10 + [[other:win10wsl|Windows Subsystem for Linux, and Ubuntu]])**. | CDAT is **available for Mac, Linux and Windows 10 (Windows 10 + [[other:win10wsl|Windows Subsystem for Linux, and Ubuntu]])**. | ||
Line 175: | Line 227: | ||
^ CDAT version ^ JYP\\ version ^ python\\ version ^ Availability? ^ Available packages ^ Installation notes ^ | ^ CDAT version ^ JYP\\ version ^ python\\ version ^ Availability? ^ Available packages ^ Installation notes ^ | ||
- | | **8.1** | 18 | 2.7.15\\ 3.6.7 | LSCE, ciclad | {{ :other:uvcdat:cdat_conda:cdat-8.1_py2_list_190307.txt |Default CDAT packages}}\\ [[other:uvcdat:cdat_conda:cdat_8_1#extra_packages_list|Extra packages]] | [[other:uvcdat:cdat_conda:cdat_8_1|8.1 notes]] | | + | | **8.2.1** | 19 | 3.8.8 | LSCE | {{ :other:uvcdat:cdat_conda:cdat_8.2.1_nompi_21-03-05.txt |Default CDAT 8.2.1 packages}}\\ [[other:uvcdat:cdat_conda:cdat_8_2_1#extra_packages_list|Extra packages]] | [[other:uvcdat:cdat_conda:cdat_8_2_1|8.2.1 notes]] | |
+ | | **8.1** | 18 | 2.7.15\\ 3.6.7 | LSCE, ciclad | {{:other:uvcdat:cdat_conda:cdat-8.1_py2_list_190307.txt|Default CDAT 8.1 packages}}\\ [[other:uvcdat:cdat_conda:cdat_8_1#extra_packages_list|Extra packages]] | [[other:uvcdat:cdat_conda:cdat_8_1|8.1 notes]] | | ||
== Initialization == | == Initialization == | ||
Line 237: | Line 290: | ||
</code> | </code> | ||
- | ==== Canopy ==== | ||
- | [[https://www.enthought.com/products/canopy/|Enthought Canopy]] is //a Scientific and Analytic Python Deployment with Integrated Analysis Environment// provided by [[https://www.enthought.com/|Enthought]]. It used to be called EPD (//Enthought Python Distribution//) | + | ==== Anaconda ==== |
- | Canopy is **available for Windows, Mac and Linux**. You can download the free //Canopy Express// that will already provide many extensions. If you are entitled to use //Canopy Academic//, login from inside Canopy Express and download the extra modules you need | + | <note tip>This is the recommended (by JYP) Python distribution/environment. It is **available for Windows, Mac and Linux**</note> |
+ | The [[https://www.anaconda.com/products/distribution|Anaconda distribution]] is provided by the [[https://www.anaconda.com/about-us|Anaconda]] company (that was [[https://www.anaconda.com/blog/continuum-analytics-officially-becomes-anaconda|previously called Continuum Analytics]]). It is similar to [[#enthought_deployment_manager_edm|EDM]], but probably more widely used than EDM | ||
- | ==== Anaconda ==== | ||
- | [[https://www.continuum.io/why-anaconda|Anaconda]] is a distribution similar to [[#canopy]] provided by [[https://www.continuum.io/|Continuum Analytics]]. | + | Note: Anaconda provides and uses ''conda'' for its installation. Since [[#cdat|CDAT]] is also installed and maintained with ''conda'', you can read the [[other:uvcdat:conda_notes|Installing and maintaining UV-CDAT with conda]] page for more information, even if you are not going to use CDAT |
- | Anaconda is **available for Windows, Mac and Linux** | + | ==== Enthought Deployment Manager (EDM) ==== |
- | Note: Anaconda provides and uses ''conda'' for its installation. Since CDAT is now also installed and maintained with ''conda'', you can read the [[other:uvcdat:conda_notes|Installing and maintaining UV-CDAT with conda]] page for more information, even if you are not going to use CDAT | + | <note tip>This was previously called //Enthought Python Distribution (EPD)// and then //Enthought Canopy//</note> |
+ | |||
+ | [[https://www.enthought.com/enthought-deployment-manager/|Enthought Deployment Manager (EDM)]] is Enthought’s mechanism to deliver scientific software applications and development environments | ||
+ | |||
+ | There are native installers for Windows (.msi), Mac OS X (.pkg), RHEL/Fedora (.rpm), and Debian/Ubuntu (.deb) | ||
===== ipython ===== | ===== ipython ===== | ||
Line 266: | Line 322: | ||
<note warning>FIXME Add a link to the new notebook page</note> | <note warning>FIXME Add a link to the new notebook page</note> | ||
+ | |||
+ | [[https://www.dataquest.io/blog/jupyter-notebook-tutorial/|Jupyter Notebook for Beginners: A Tutorial]] | ||
The ipython notebook is a way to interact with python (and other supported interpreted languages) inside a web browser. You can mix //cells// with python commands, cells with the output of the python commands (possibly graphics generated by the commands), and text (using some wiki-like rich text format). This interactive web page, aka notebook, can be saved in a ''my_notebook.ipynb'' file and re-used later (e.g. the notebook provided in the [[other:python:jyp_steps#part_1|introduction to Python, part 1]]). | The ipython notebook is a way to interact with python (and other supported interpreted languages) inside a web browser. You can mix //cells// with python commands, cells with the output of the python commands (possibly graphics generated by the commands), and text (using some wiki-like rich text format). This interactive web page, aka notebook, can be saved in a ''my_notebook.ipynb'' file and re-used later (e.g. the notebook provided in the [[other:python:jyp_steps#part_1|introduction to Python, part 1]]). |