Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Krause
tardis-doc
Commits
805015b8
Commit
805015b8
authored
Sep 19, 2019
by
Michael Krause
🎉
Browse files
software: add conda
parent
ea824bb4
Pipeline
#3568
passed with stages
in 38 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
index.rst
View file @
805015b8
...
@@ -4,6 +4,9 @@ Welcome to Tardis's documentation!
...
@@ -4,6 +4,9 @@ Welcome to Tardis's documentation!
Changelog
Changelog
=========
=========
3.6.1 (19.09.2019)
+ added minimal howto for Conda
3.6.1 (19.09.2019)
3.6.1 (19.09.2019)
+ updated SPM12 section (env modules)
+ updated SPM12 section (env modules)
...
...
software/python.rst
View file @
805015b8
...
@@ -158,6 +158,75 @@ directly. It is much more convenient to use the wrapper functions though.
...
@@ -158,6 +158,75 @@ directly. It is much more convenient to use the wrapper functions though.
:file:`source /etc/bash_completion` **or** :file:`module load virtualenvwrapper`
:file:`source /etc/bash_completion` **or** :file:`module load virtualenvwrapper`
Conda
-----
Another approach to virtual environments (and a whole virtual operating system
in fact) is provided by a third party, commercial python distribution called
`Anaconda`_ (:file:`conda`). Though discouraged for smaller projects, you can
use an environment module to load and activate a (mini)conda distribution on the
Tardis:
.. code-block:: bash
[krause@master ~] module avail conda
-------- /opt/environment/modules --------
conda/4.7.10
[krause@master ~] module load conda
[krause@master ~] conda -V
conda 4.7.10
Once loaded, just like with `pyvenv` or `virtualenv`, you can create and manage
multiple conda environments and keep specific python versions and their library
dependencies in it. Note however, that conda will also download and manage
a large number of system libraries, which *may* make bugs very hard to debug
and could lead to unexpected reproducibility issues. Some software however can
only be installed with conda and I strongly recommend to limit the use of conda
for those specific projects.
One example of those projects is Theano and its optional dependency pygpu. To
install Theano (or other conda-only packages) you can create a new environment:
.. code-block:: bash
[krause@master ~] module load conda # activate conda itself
[krause@master ~] conda create --yes --name theano
Collecting package metadata (current_repodata.json): done
Solving environment: done
[...]
[krause@master ~] conda activate theano # activate a conda env
(theano) [krause@master ~] # now you can install packages into the env
(theano) [krause@master ~] conda install --yes numpy scipy mkl
[...]
(theano) [krause@master ~] conda install --yes theano pygpu
(theano) [krause@master ~] which python
/home/beegfs/krause/.conda/envs/theano/bin/python
(theano) [krause@master ~] python
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano as t
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
>>>
To deactivate (and possibly remove) an existing conda environment, run:
.. code-block:: bash
(theano) [krause@master ~] conda deactivate
[krause@master ~] # deactivated, safe to remove
[krause@master ~] conda remove --yes --name theano --all
Remove all packages in environment /home/beegfs/krause/.conda/envs/theano:
[...]
.. _PyPI: https://pypi.python.org/pypi
.. _PyPI: https://pypi.python.org/pypi
.. _pyvenv: https://virtualenvwrapper.readthedocs.io/en/latest
.. _pyvenv: https://virtualenvwrapper.readthedocs.io/en/latest
.. _virtualenvwrapper: https://packaging.python.org/installing/#creating-virtual-environments
.. _virtualenvwrapper: https://packaging.python.org/installing/#creating-virtual-environments
.. _Anaconda: https://docs.conda.io/projects/conda
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment