Anaconda: Difference between revisions

From LWP-Wiki
Jump to navigation Jump to search
No edit summary
m (State use of Anaconda at beginning, add example of installing specific Python version)
Line 1: Line 1:
[[Category:anaconda-faq]]
[[Category:anaconda-faq]]1
The '''Anaconda''' Python distribution is available on LWP over and NFS mount. In order to use it on LWP instead of the locally installed Python, you need to load some environment variables into your shell.
The '''Anaconda''' Python distribution allows you to set up a personal environment to install Python libraries/packages/modules in your Home directory, including different version of Python. This is helpful if you require a newer Version than is available on your system. Anaconda is available on LWP through a NFS mount. In order to use it on LWP instead of the locally installed Python, you need to load some environment variables into your shell.


To make Anaconda available in just your current ''bash'' session:
To make Anaconda available in just your current ''bash'' session:
Line 15: Line 15:
====Custom environments====
====Custom environments====


In order to be able to install additional packages using <code>conda install <package></code> you'll need to your own ''environment''. Such environment is stored in your home directory so it can be written to by you. By the commands above activate anaconda's default environment ''base'' and because it is stored centrally on the network it's not writable.
In order to be able to install additional packages using <code>conda install <package></code> you'll need to your own ''environment''. Such environment is stored in your home directory so it can be written to by you. By the commands above activate anaconda's default environment ''base'' and because it is stored centrally on the network it's not writeable.


To create your own environment called "xmpl" (it's recommended to keep the name short):
To create your own environment called "xmpl" (it's recommended to keep the name short):
Line 25: Line 25:
   '''bash$''' conda activate xmpl
   '''bash$''' conda activate xmpl


Custom environments also allow you to use specific versions of python itself and/or module packages. For more information see [https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-environments the conda documentation about environments].
Custom environments also allow you to use specific versions of python itself and/or module packages, for example
 
  '''bash$''' conda install python=3.11


For more information see:
For more information see:
 
* [https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-environments the conda documentation about environments].
* https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)
* https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)
* https://docs.anaconda.com/anaconda/user-guide/
* https://docs.anaconda.com/anaconda/user-guide/

Revision as of 16:59, 29 June 2023

1 The Anaconda Python distribution allows you to set up a personal environment to install Python libraries/packages/modules in your Home directory, including different version of Python. This is helpful if you require a newer Version than is available on your system. Anaconda is available on LWP through a NFS mount. In order to use it on LWP instead of the locally installed Python, you need to load some environment variables into your shell.

To make Anaconda available in just your current bash session:

 bash$ source /opt/netapps/anaconda-lwp4/etc/profile.d/conda.sh
 bash$ conda activate

To have your shell startup files managed by Anaconda, so it will be available any time you start your shell:

 bash$ conda init

And after this, close and re-open your shell. Note that this last command also works with a select few other shells.

Custom environments

In order to be able to install additional packages using conda install <package> you'll need to your own environment. Such environment is stored in your home directory so it can be written to by you. By the commands above activate anaconda's default environment base and because it is stored centrally on the network it's not writeable.

To create your own environment called "xmpl" (it's recommended to keep the name short):

 bash$ conda create --name xmpl

Activate this with:

 bash$ conda activate xmpl

Custom environments also allow you to use specific versions of python itself and/or module packages, for example

 bash$ conda install python=3.11

For more information see: