anaconda
De Wikicima
(Diferencias entre revisiones)
(Final) |
(→cration of an environtment) |
||
(No se muestran 8 ediciones intermedias realizadas por un usuario) | |||
Línea 1: | Línea 1: | ||
CIMA's ciomputational resources have conda installed. This facilitates the individualized management of, for example, python |
CIMA's ciomputational resources have conda installed. This facilitates the individualized management of, for example, python |
||
+ | |||
+ | = Install = |
||
+ | In case you want to install (in any other machine!) |
||
+ | # Getting to the downloads folder |
||
+ | <pre> |
||
+ | $ mkdir Downloads |
||
+ | $ cd Downloads |
||
+ | </pre> |
||
+ | # Getting the installer for python 2.7 |
||
+ | <pre> |
||
+ | wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh |
||
+ | </pre> |
||
+ | # Execution of the installer |
||
+ | <pre> |
||
+ | $ bash Anaconda2-4.4.0-Linux-x86_64.sh |
||
+ | (...) |
||
+ | install path: /home/lluis.fita/bin/anaconda2 |
||
+ | (...) |
||
+ | Do you wish the installer to prepend the Anaconda2 install location |
||
+ | to PATH in your /home/lluis.fita/.bashrc ? [yes|no] |
||
+ | >>> no |
||
+ | You may wish to edit your .bashrc or prepend the Anaconda2 install location: |
||
+ | $ export PATH=/home/lluis.fita/bin/anaconda2/bin:$PATH |
||
+ | Thank you for installing Anaconda2! |
||
+ | Share your notebooks and packages on Anaconda Cloud! |
||
+ | </pre> |
||
+ | # Anaconda’s python as: |
||
+ | <pre> |
||
+ | $ /home/lluis.fita/bin/anaconda2/bin/python |
||
+ | Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15) |
||
+ | [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)4] on linux2 |
||
+ | Type "help", "copyright", "credits" or "license" for more information. |
||
+ | Anaconda is brought to you by Continuum Analytics. |
||
+ | Please check out: http://continuum.io/thanks and https://anaconda.org |
||
+ | </pre> |
||
+ | |||
+ | == Installing packages == |
||
+ | Steps to follow to install a package |
||
+ | # Let’s install netcdf4 |
||
+ | <pre> |
||
+ | $ ${HOME}/bin/anaconda2/bin/conda install netcdf4 |
||
+ | Fetching package metadata ......... |
||
+ | Solving package specifications: . |
||
+ | Package plan for installation in environment /home/lluis.fita/bin/anaconda2: |
||
+ | The following NEW packages will be INSTALLED: |
||
+ | hdf4: 4.2.12-1 |
||
+ | libnetcdf: 4.4.1-1 |
||
+ | netcdf4: 1.2.4-np112py27_0 |
||
+ | The following packages will be UPDATED: |
||
+ | anaconda: 4.4.0-np112py27_0 –> custom-py27_0 |
||
+ | conda: 4.3.21-py27_0 –> 4.3.22-py27_0 |
||
+ | The following packages will be DOWNGRADED: |
||
+ | curl: 7.52.1-0 –> 7.49.0-1 |
||
+ | pycurl: 7.43.0-py27_2 –> 7.43.0-py27_0 |
||
+ | Proceed ([y]/n)? y |
||
+ | </pre> |
||
= cration of an environtment = |
= cration of an environtment = |
||
− | A python environtment is useful to have set-up an specific set of packages to be used for python. Folowing instructions from conda [ https://conda.io/docs/user-guide/tasks/manage-environmentshtml#creating-an-environment-with-commands EnvironmentCreation] |
+ | A python environtment is useful to have set-up an specific set of packages to be used for python. Folowing instructions from conda [https://conda.io/docs/user-guide/tasks/manage-environments.html EnvironmentCreation] |
# Creation of the environemnt called ‘lluis’ with ptyhon 2.7 version of codes |
# Creation of the environemnt called ‘lluis’ with ptyhon 2.7 version of codes |
||
<pre> |
<pre> |
||
− | conda create –name lluis lluis python=2.7 |
+ | conda create --name lluis python=2.7 |
</pre> |
</pre> |
||
# To activate the environment |
# To activate the environment |
||
<pre> |
<pre> |
||
− | $ source activate lluis |
+ | $ source ~/bin/anaconda2/bin/activate lluis |
(lluis) $ |
(lluis) $ |
||
</pre> |
</pre> |
||
Línea 34: | Línea 90: | ||
<pre> |
<pre> |
||
$ pip install numpy |
$ pip install numpy |
||
+ | </pre> |
||
+ | # Deactivate environtment: |
||
+ | <pre> |
||
+ | (lluis) $ source ~/bin/anaconda2/bin/deactivate |
||
+ | $ |
||
</pre> |
</pre> |
Última revisión de 17:55 19 nov 2018
CIMA's ciomputational resources have conda installed. This facilitates the individualized management of, for example, python
[editar] Install
In case you want to install (in any other machine!)
- Getting to the downloads folder
$ mkdir Downloads $ cd Downloads
- Getting the installer for python 2.7
wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh
- Execution of the installer
$ bash Anaconda2-4.4.0-Linux-x86_64.sh (...) install path: /home/lluis.fita/bin/anaconda2 (...) Do you wish the installer to prepend the Anaconda2 install location to PATH in your /home/lluis.fita/.bashrc ? [yes|no] >>> no You may wish to edit your .bashrc or prepend the Anaconda2 install location: $ export PATH=/home/lluis.fita/bin/anaconda2/bin:$PATH Thank you for installing Anaconda2! Share your notebooks and packages on Anaconda Cloud!
- Anaconda’s python as:
$ /home/lluis.fita/bin/anaconda2/bin/python Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)4] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org
[editar] Installing packages
Steps to follow to install a package
- Let’s install netcdf4
$ ${HOME}/bin/anaconda2/bin/conda install netcdf4 Fetching package metadata ......... Solving package specifications: . Package plan for installation in environment /home/lluis.fita/bin/anaconda2: The following NEW packages will be INSTALLED: hdf4: 4.2.12-1 libnetcdf: 4.4.1-1 netcdf4: 1.2.4-np112py27_0 The following packages will be UPDATED: anaconda: 4.4.0-np112py27_0 –> custom-py27_0 conda: 4.3.21-py27_0 –> 4.3.22-py27_0 The following packages will be DOWNGRADED: curl: 7.52.1-0 –> 7.49.0-1 pycurl: 7.43.0-py27_2 –> 7.43.0-py27_0 Proceed ([y]/n)? y
[editar] cration of an environtment
A python environtment is useful to have set-up an specific set of packages to be used for python. Folowing instructions from conda EnvironmentCreation
- Creation of the environemnt called ‘lluis’ with ptyhon 2.7 version of codes
conda create --name lluis python=2.7
- To activate the environment
$ source ~/bin/anaconda2/bin/activate lluis (lluis) $
- Knowing packages of the environtment:
$ conda list -n lluis # packages in environment at /home/lluis.fita/datosskogul/minconda3/envs/lluis: # ca-certificates 2017.7.27.1 0 conda-forge certifi 2017.7.27.1 py27_0 conda-forge ncurses 5.9 10 conda-forge openssl 1.0.2l 0 conda-forge pip 9.0.1 py27_0 conda-forge python 2.7.14 0 conda-forge readline 6.2 0 conda-forge setuptools 36.6.0 py27_1 conda-forge sqlite 3.13.0 1 conda-forge tk 8.5.19 2 conda-forge wheel 0.30.0 py_1 conda-forge zlib 1.2.8 3 conda-forge
- To install a pakage (assuming pip is already in the environtment!):
$ pip install numpy
- Deactivate environtment:
(lluis) $ source ~/bin/anaconda2/bin/deactivate $