anaconda

De Wikicima
(Diferencias entre revisiones)
Saltar a: navegación, buscar
(cration of an environtment)
(cration of an environtment)
 
(No se muestran 2 ediciones intermedias realizadas por un usuario)
Línea 62: Línea 62:
 
# 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 93: Línea 93:
 
# Deactivate environtment:
 
# Deactivate environtment:
 
<pre>
 
<pre>
(lluis) $ source deactivate
+
(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!)

  1. Getting to the downloads folder
$ mkdir Downloads
$ cd Downloads
  1. Getting the installer for python 2.7
wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh
  1. 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!
  1. 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

  1. 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

  1. Creation of the environemnt called ‘lluis’ with ptyhon 2.7 version of codes
conda create --name lluis python=2.7
  1. To activate the environment
$ source ~/bin/anaconda2/bin/activate lluis
(lluis) $
  1. 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
  1. To install a pakage (assuming pip is already in the environtment!):
$ pip install numpy
  1. Deactivate environtment:
(lluis) $ source ~/bin/anaconda2/bin/deactivate
$
Herramientas personales