Skip to content

Commit

Permalink
DOC: Document installer uninstallation (#12845)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Sep 18, 2024
1 parent 2cab025 commit efe8b6a
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 17 deletions.
3 changes: 3 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ view:
@python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/_build/html/sg_execution_times.html')"

show: view

serve:
python -m http.server -d _build/html
35 changes: 24 additions & 11 deletions doc/_static/js/set_installer_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,34 @@ function setTabs() {
}
if (navigator.userAgent.indexOf("Mac") !== -1) {
// there's no good way to distinguish intel vs M1 in javascript so we
// just default to showing the first of the 2 macOS tabs
platform = "macos-intel";
// just default to showing the most modern macOS installer
platform = "macos-apple";
}
let all_tab_nodes = document.querySelectorAll(
'.platform-selector-tabset')[0].children;
let input_nodes = [...all_tab_nodes].filter(
child => child.nodeName === "INPUT");
var platform_short = platform.split("-")[0];

let tab_label_nodes = [...document.querySelectorAll('.sd-tab-label')];
let correct_label = tab_label_nodes.filter(

let install_tab_nodes = document.querySelectorAll(
'.install-selector-tabset')[0].children;
let install_input_nodes = [...install_tab_nodes].filter(
child => child.nodeName === "INPUT");
let install_label = tab_label_nodes.filter(
// label.id is drawn from :name: property in the rST, which must
// be unique across the whole site (*sigh*)
label => label.id.startsWith(platform))[0];
let input_id = correct_label.getAttribute('for');
let correct_input = input_nodes.filter(node => node.id === input_id)[0];
correct_input.checked = true;
label => label.id.startsWith(`install-${platform}`))[0];
let install_id = install_label.getAttribute('for');
let install_input = install_input_nodes.filter(node => node.id === install_id)[0];
install_input.checked = true;

let uninstall_tab_nodes = document.querySelectorAll(
'.uninstall-selector-tabset')[0].children;
let uninstall_input_nodes = [...uninstall_tab_nodes].filter(
child => child.nodeName === "INPUT");
let uninstall_label = tab_label_nodes.filter(
label => label.id.startsWith(`uninstall-${platform_short}`))[0];
let uninstall_id = uninstall_label.getAttribute('for');
let uninstall_input = uninstall_input_nodes.filter(node => node.id === uninstall_id)[0];
uninstall_input.checked = true;
}

documentReady(setTabs);
2 changes: 1 addition & 1 deletion doc/_static/js/update_installer_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function warnVersion() {
title.innerText = "Warning";
inner.innerText = warn;
outer.append(title, inner);
document.querySelectorAll('.platform-selector-tabset')[0].before(outer);
document.querySelectorAll('.install-selector-tabset')[0].before(outer);
}
}

Expand Down
64 changes: 59 additions & 5 deletions doc/install/installers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ MNE-Python installers are the easiest way to install MNE-Python and
all dependencies. They also provide many additional
Python packages and tools. Got any questions? Let us know on the `MNE Forum`_!

Platform-specific installers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. tab-set::
:class: platform-selector-tabset
:class: install-selector-tabset

.. tab-item:: Linux
:class-content: text-center
:name: linux-installers
:name: install-linux

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-Linux.sh
:ref-type: ref
Expand All @@ -33,7 +36,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_!
.. tab-item:: macOS (Intel)
:class-content: text-center
:name: macos-intel-installers
:name: install-macos-intel

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-macOS_Intel.pkg
:ref-type: ref
Expand All @@ -49,7 +52,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_!

.. tab-item:: macOS (Apple Silicon)
:class-content: text-center
:name: macos-apple-installers
:name: install-macos-apple

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-macOS_M1.pkg
:ref-type: ref
Expand All @@ -65,7 +68,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_!

.. tab-item:: Windows
:class-content: text-center
:name: windows-installers
:name: install-windows

.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-Windows.exe
:ref-type: ref
Expand Down Expand Up @@ -107,3 +110,54 @@ bundles to the ``Applications`` folder on macOS.
applications to start, especially on the very first run – which may take
particularly long on Apple Silicon-based computers. Subsequent runs should
usually be much faster.

Uninstallation
^^^^^^^^^^^^^^

To remove the MNE-Python distribution provided by our installers above:

1. Remove relevant lines from your shell initialization scripts if you
added them at installation time. To do this, you can run from the MNE Prompt:

.. code-block:: bash
$ conda init --reverse
Or you can manually edit shell initialization scripts, e.g., ``~/.bashrc`` or
``~/.bash_profile``.

2. Follow the instructions below to remove the MNE-Python conda installation for your platform:

.. tab-set::
:class: uninstall-selector-tabset

.. tab-item:: Linux
:name: uninstall-linux

In a BASH terminal you can do:

.. code-block:: bash
$ which python
/home/username/mne-python/1.8.0_0/bin/python
$ rm -Rf /home/$USER/mne-python
$ rm /home/$USER/.local/share/applications/mne-python-*.desktop
.. tab-item:: macOS
:name: uninstall-macos

You can simply `drag the MNE-Python folder to the trash in the Finder <https://support.apple.com/en-us/102610>`__.

Alternatively, you can do something like:

.. code-block:: bash
$ which python
/Users/username/Applications/MNE-Python/1.8.0_0/.mne-python/bin/python
$ rm -Rf /Users/$USER/Applications/MNE-Python # if user-specific
$ rm -Rf /Applications/MNE-Python # if system-wide
.. tab-item:: Windows
:name: uninstall-windows

To uninstall MNE-Python, you can remove the application using the `Windows Control Panel <https://support.microsoft.com/en-us/windows/uninstall-or-remove-apps-and-programs-in-windows-4b55f974-2cc6-2d2b-d092-5905080eaf98>`__.

0 comments on commit efe8b6a

Please sign in to comment.