File: updating.rst

package info (click to toggle)
python-mne 1.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 131,492 kB
  • sloc: python: 213,302; javascript: 12,910; sh: 447; makefile: 144
file content (85 lines) | stat: -rw-r--r-- 3,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Updating MNE-Python
===================

If you want to update MNE-Python to a newer version, there are a few different
options, depending on how you originally installed it.

.. hint::
   To update via the :ref:`MNE-Python installers <installers>`, simply
   download and run the latest installer for your platform. MNE-Python will be
   installed in parallel to your existing installation, which you may uninstall
   or delete if you don't need it anymore.

If you're not using the MNE-Python installers, keep reading.


Upgrading MNE-Python only
^^^^^^^^^^^^^^^^^^^^^^^^^

If you wish to update MNE-Python only and leave other packages in their current
state, you can usually safely do this with ``pip``, even if you originally
installed via conda. With the ``mne`` environment active
(``conda activate name_of_environment``), do:

.. code-block:: console

    $ pip install -U mne


Upgrading all packages
^^^^^^^^^^^^^^^^^^^^^^

Generally speaking, if you want to upgrade *your whole software stack*
including all the dependencies, the best approach is to re-create it as a new
virtual environment, because neither conda nor pip are fool-proof at making
sure all packages remain compatible with one another during upgrades.

Here we'll demonstrate renaming the old environment first, as a safety measure.
We'll assume that the existing environment is called ``mne`` and you want to
rename the old one so that the new, upgraded environment can be called ``mne``
instead.

.. warning::

    Before running the below command, ensure that your existing MNE conda
    environment is **not** activated. Run ``conda deactivate`` if in doubt.

.. code-block:: console

    $ conda rename --name=mne old_mne  # rename existing "mne" env to "old_mne"

Then, just follow our regular installation instructions, :ref:`manual-install`.

.. note::

    If you installed extra packages into your old ``mne`` environment,
    you'll need to repeat that process after re-creating the updated
    environment. Comparing the output of ``conda list --name old_mne`` versus
    ``conda list --name mne`` will show you what is missing from the new
    environment. On Linux, you can automate that comparison like this:

    .. code-block:: console

        $ diff <(conda list -n mne | cut -d " " -f 1 | sort) <(conda list -n old_mne | cut -d " " -f 1 | sort) | grep "^>" | cut -d " " -f 2


.. _installing_main:

Upgrading to the development version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. warning::
    :class: sidebar

    In between releases, function and class APIs can change without
    warning.

Sometimes, new features or bugfixes become available that are important to your
research and you just can't wait for the next official release of MNE-Python to
start taking advantage of them. In such cases, you can use ``pip`` to install
the *development version* of MNE-Python. Ensure to activate the MNE conda
environment first by running ``conda activate mne``.

.. code-block:: console

    $ pip install -U --no-deps https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip