Software:Python (MiniConda): Difference between revisions

From Atmospheric and Oceanic Science
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 7: Line 7:
# Install the package with the following command: <code> bash Miniconda3-latest-Linux-x86_64.sh</code>, accepting the default values for all the questions.
# Install the package with the following command: <code> bash Miniconda3-latest-Linux-x86_64.sh</code>, accepting the default values for all the questions.
# To make the changes take effect, close and then re-open your terminal window.
# To make the changes take effect, close and then re-open your terminal window.
# Test your installation. In your terminal window run the command conda list. A list of installed packages appears if it has been installed correctly. <ref> [https://conda.io/projects/conda/en/stable/user-guide/install/linux.html#install-linux-silent Miniconta Installation on Linux] </ref>
# Test your installation. In your terminal window run the command conda list. A list of installed packages appears if it has been installed correctly. <ref> [https://conda.io/projects/conda/en/stable/user-guide/install/linux.html#install-linux-silent Miniconda Installation on Linux] </ref>


=== Using python ===
If Conda has been properly installed, your shell prompt in your terminal will change from <code> [username@workstation ~]$ </code> to <code> (base) [username@workstation ~]$ </code>.  The <code>(base)</code> means that conda python has activated your base environment.  You can create multiple environments, and activate them separately.  This is useful if you want different versions of numpy (e.g.) for different packages.  When you are in an activated environment, you can install any packages you need with <code> conda install PACKAGE_NAME </code> in that environment.
=== Jupyter === 
Jupyter can be installed with <code> conda install jupyter </code>.
Once installed you can invoke it with <code> jupyter notebook </code>.  This will open a browser window on your GUI and you can start using jupyter.  If you are connecting remotely to a server, you will need to either use remote desktop software, or [[IT:Secure shell (ssh)|With Tunelling]] to get a Jupyter browser window on you computer from the server.
== Notes ==
== Notes ==
<references />
<references />

Latest revision as of 21:48, 10 May 2023

Using Python

Python is already installed on all Linux workstations. However the python istalled is used by the system packages, and cannot be updated. For general programming, and to have more current versions of python, and dependencies, I recommend the installation of conda/miniconda in your home directory. In this way, you can manage the versions of numpy, scipy, jupyter etc independently of the python that is installed on the system

Miniconda Installation

  1. Download the miniconda package (Miniconda3 Linux 64-bit) from the main Miniconda website.
  2. Open a terminal, move the downloaded file to your home directory: mv ~/Downloads/Miniconda3-latest-Linux-x86_64.sh ~
  3. Install the package with the following command: bash Miniconda3-latest-Linux-x86_64.sh, accepting the default values for all the questions.
  4. To make the changes take effect, close and then re-open your terminal window.
  5. Test your installation. In your terminal window run the command conda list. A list of installed packages appears if it has been installed correctly. [1]

Using python

If Conda has been properly installed, your shell prompt in your terminal will change from [username@workstation ~]$ to (base) [username@workstation ~]$ . The (base) means that conda python has activated your base environment. You can create multiple environments, and activate them separately. This is useful if you want different versions of numpy (e.g.) for different packages. When you are in an activated environment, you can install any packages you need with conda install PACKAGE_NAME in that environment.

Jupyter

Jupyter can be installed with conda install jupyter . Once installed you can invoke it with jupyter notebook . This will open a browser window on your GUI and you can start using jupyter. If you are connecting remotely to a server, you will need to either use remote desktop software, or With Tunelling to get a Jupyter browser window on you computer from the server.

Notes