Although creating a virtual environment for each project is considered best practice, it can be a major obstacle for early-career neuroscientists that are just starting to learn programming. neuro-conda aims to simplify learning and using Python in neuroscience by bundling commonly used packages in neuroscience into curated conda environments, i.e. providing a Python distribution for neuroscience based on conda.
Currently neuro-conda includes the following neuroscientific Python packages (in alphabetic order):
-
Electrophysiology (spikes + LFP): brian2, elephant, viziphant, esi-syncopy, neurotic, pynapple, spyking-circus, spikeinterface, spikeinterface-gui, suite2p
-
Electrophysiology (LFP + M/EEG): bycycle, fooof, neurodsp, mne (including the extensions alphaCSC, eelbrain, invertmeeg (only on Linux), mne-ari, mne-bids, mne-bids-pipeline, mne-connectivity, mne-features, mne-icalabel, mnelab, mne-microstates, mne-nirs, mne-realtime, mne-rsa, neurokit2, pactools, pyprep, sesameeg),
-
Neuroimaging: dipy, intensity-normalization
-
File/data formats: neo, nibabel, napari-nibabel, nixio, pybids, pydicom + deid, pynwb
-
Machine Learning: nilearn, nipype, nitime (only on Windows and Linux), PyTorch, scikit-learn, tensorflow,
More neuroscience tools will be added in the future. Please open an issue or pull request if you'd like a specific package to be included.
- Other useful packages are (see the environment files for details): black, flake8 + pep8-naming, HDF5 + h5py, imageio, jupyter, NumPy, SciPy, Matplotlib + Seaborn, mat 7.3,
neuro-conda is inspired by similar projects at the Ernst StrΓΌngmann Institute for Neuroscience, University of Cambridge and NeuroDesk, providing easy-to-install Python environments for neuroscience.
Open a PowerShell and run the following command:
irm https://neuro-conda.github.io/neuro-conda/libexec/install.ps1 | iex
Open a terminal (Terminal.App
in macOS) and run the following command:
curl -fsSL https://neuro-conda.github.io/neuro-conda/libexec/install.sh | bash
Invoke-WebRequest "https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/envs/neuro-conda-latest.yml" -OutFile "$Env:temp\neuro-conda-latest.yml"
conda env create --file "$Env:temp\neuro-conda-latest.yml"
wget "https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/envs/neuro-conda-latest.yml" -O /tmp/neuro-conda-latest.yml
conda env create --file /tmp/neuro-conda-latest.yml
Open a PowerShell and run the following command:
Invoke-WebRequest https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/libexec/uninstall.ps1 -OutFile $Env:temp\uninstall_neuroconda.ps1; Invoke-Expression $Env:temp\uninstall_neuroconda.ps1;
Open a terminal and run the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/libexec/uninstall.sh)"
The following environment variables can be used to control the neuro-conda installer/uninstaller (detailed explanation below).
Variable | Description | Windows | Linux/WSL | macOS |
---|---|---|---|---|
ncTargetDirectory |
installation location | β | β | β |
ncDebug |
show debug messages | β | β | β |
ncEnv |
choose neuro-conda environment | β | β | β |
ncEditor |
install Spyder | β | β | β |
ncNoninteractive |
do not prompt for input | β | β | β |
ncCI |
CI pipeline mode | β | β | β |
The variables have to be set before running the neuro-conda installer/uninstaller and must be available to other processes started by the installer, e.g.,
-
Linux/macOS/WSL:
export ncDebug=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/libexec/install.sh)"
-
Windows PowerShell:
$Env:ncDebug = 1 Invoke-WebRequest https://raw.githubusercontent.com/neuro-conda/neuro-conda/main/libexec/install.ps1 -OutFile $Env:temp\install_neuroconda.ps1; Invoke-Expression $Env:temp\install_neuroconda.ps1;
Specify the location of the neuro-conda installation. By default, neuro-conda is installed inside the active user's home directory. Note that the specified directory must not exist.
- Linux/macOS/WSL: By default,
ncTargetDirectory="${HOME}/.local/miniconda3"
, to install neuro-conda to/path/to/conda
useexport ncTargetDirectory="/path/to/conda"
- Windows PowerShell: By default, neuro-conda is installed in the directory "miniconda3"
inside the active user's home folder (usually
C:\Users\<username>
). If no active user is detected or the username contains spaces, the installer falls back on the "public" folder (usuallyC:\Users\Public
). To point the installer to another location use, e.g.,$Env:ncTargetDirectory = "F:\work\neuro-conda"
If set, the (un)installer prints (a lot of) additional progress/status messages.
Note that the actual value of ncDebug
is irrelevant, if the variable is
set (to anything), the (un)installer picks it up.
- Linux/macOS/WSL: By default,
ncDebug
is not defined. Setting it to an arbitrary value, e.g.,export ncDebug=1
activates debug messaging. - Windows PowerShell: By default
ncDebug
is not set. Debug messages are shown ifncDebug
is set to an arbitrary value, e.g.,$Env:ncDebug = 1
Specifies the environment to create during the installation process. By default, the installer always creates the most recent neuro-conda environment defined in the YAML file neuro-conda-latest.yml (consult the envs directory for all available environments)
βΉοΈ INFO As of June 2023, neuro-conda only ships with a single environment file (
neuro-conda-latest.yml
) that contains the environmentneuro-conda-2023a
. SettingncEnv
to anything other thanneuro-conda-2023a
results in an error.
- Linux/macOS/WSL: To create an older neuro-conda environment, use, e.g.,
export ncEnv="neuro-conda-2023a"
- Windows PowerShell: To create a specific neuro-conda environment,
use, e.g.,
$Env:ncEnv = "neuro-conda-2023a"
If set, the Python IDE Spyder is installed alongside neuro-conda.
- Linux/macOS/WSL: By default,
ncEditor
is not defined. Setting it to an arbitrary value, e.g.,export ncEditor=1
installs Spyder. - Windows PowerShell: Not yet supported.
If set, the (un)installer does not ask for confirmation. The actual value of
ncNonInteractive
is irrelevant, if the variable is set (to anything),
any confirmation dialogs will be automatically answered with "yes".
By default, the (un)installer asks the user for confirmation when performing
changes to the system.
β οΈ WARNING The (un)installer only asks for confirmation before making permanent changes to the system. Automatically confirming all dialogs without double-checking may result in damaged installations.
- Linux/macOS/WSL: By default,
ncNonInteractive
is not defined. Setting it to an arbitrary value, e.g.,export ncNonInteractive=1
prevents the (un)installer from prompting for confirmation - Windows PowerShell: By default
ncNonInteractive
is not set. All confirmation dialogs are automatically answered with "yes" ifncNonInteractive
is set to an arbitrary value, e.g.,$Env:ncNonInteractive = 1
If set, the (un)installer assumes it was executed by a continuous integration
pipeline (e.g., GitHub Action) and
activates ncNonInteractive
. Note that the actual value of ncCI
is
irrelevant, if the variable is set (to anything), the (un)installer picks
it up.
β οΈ WARNING SettingncCI
turns off all confirmation prompts (seencNonInteractive
above).
- Linux/macOS/WSL: By default,
ncCI
is not defined. Setting it to an arbitrary value, e.g.,export ncCI=1
activates CI mode. - Windows PowerShell: By default
ncCI
is not set. CI mode is activated ifncCI
is set to an arbitrary value, e.g.,$Env:ncCI = 1
Coming soon...