Configuration and troubleshooting
Use this route when Brian2 cannot be imported, a package/compiler prerequisite
is unclear, a preference unexpectedly changes the code-generation or cache
configuration, or a log is needed to classify a failure. This route covers
Brian2 2.9.0 with Python >=3.12 and the brian2 import root.
Route quickly
- Establish identity and baseline. From the directory containing this
sub-skill's bundled
scripts/ directory (or by passing that script's
relative path), run python scripts/check_brian2_env.py. Confirm Python
=3.12, distribution Brian2==2.9.0, every declared base dependency and
version constraint, and that an incomplete source checkout is not shadowing
the intended installation. The checker is read-only and does not reveal
executable or cache paths.
- Repair installation before configuration. Follow
installation in an isolated environment. Do
not mix a checkout import with a separately installed distribution. If the
checker reports a required import or version failure, fix that first and
retest in a fresh interpreter.
- Inspect effective preferences and cache state. Read
preferences and cache before changing
prefs.codegen.target, compiler settings, or Cython cache settings. The
current-directory preference file overrides the user preference file.
- Capture evidence and classify the first failure. Use
troubleshooting to preserve the exception,
Python/package versions, target, compiler names, relevant preferences, and
Brian debug-log information before retrying or clearing a cache.
- Choose the smallest validation. A NumPy-target tiny model checks core
Python execution. A Cython or C++ build is a separate native gate and can
write cache/project files; run it only as an explicitly approved local
check.
Scope and routing boundaries
This route owns installation, importability, required package presence,
compiler/Cython prerequisite diagnosis, preference-file precedence and
validation, cache ownership/permissions, logging diagnostics, and generic
failure triage. It does not own detailed code-generation target selection,
generated-code APIs, standalone project design, model equations, scheduling,
or workflow-specific failures. After recording environment facts here, route
those details to code-generation,
modeling,
simulation-and-recording,
recording,
spatial-models, or
units-and-equations, respectively.
Optional packages are capability boundaries, not automatic requirements:
- SciPy is required for selected NumPy spatial/multicompartment operations;
Matplotlib is for plotting; Pandas is for state import/export formats;
IPython/Jupyter is for interactive notebooks; and
brian2tools is a separate
visualization/analysis package.
- GSL support means a native GSL installation with headers/libraries as well as
Brian's integration; a Python import or library-name probe alone cannot prove
it. Route GSL state-updater/code-generation use to code-generation.
pytest>=8 is the test extra needed by brian2.test(). A full test run is
not the default response to a user-model failure.
Safety and acceptance
- Do not install packages, use network commands, compile extensions, clear
caches, delete standalone output, or edit preference files during a
read-only diagnosis.
- Treat
import brian2 as necessary but insufficient: target, compiler,
optional capability, cache access, and requested workflow need separate
evidence.
- Treat an unknown version, failed required import, old Python, unavailable
compiler for a compiled target, unreadable cache, invalid preference file,
and unresolved optional native dependency as explicit unresolved limits.
brian2.test() resets preferences while it runs and restores them afterward;
use a narrow target/marker selection when diagnosing rather than launching
the complete suite by default.
Bundled operating files
- installation.md: package identity, baseline
dependencies, pip/Conda installation, compiler prerequisites, and optional
capability boundaries.
- preferences-and-cache.md: preference
access, file syntax and precedence, effective target/cache inspection,
cache-clearing safeguards, and NFS/process guidance.
- troubleshooting.md: install/import,
compiler/Cython, optional dependency, configuration/data, API, logging, and
workflow triage with routing boundaries.
- check_brian2_env.py: non-mutating compact or
JSON environment report. Use
--help first; --strict gates required
Python/package/import/version checks, and --require-compiler adds a
compiler-name gate.
The script reports compiler names and capability states, not local paths,
Python prefixes, or cache locations.
1---2name: configuration-and-troubleshooting3description: "Install and validate Brian2 2.9.0 environments, configure4 preferences, caches, and logging, and triage import, compiler,5 optional-dependency, and common runtime failures."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/configuration-and-troubleshooting9 disco-role: operating10license: NOASSERTION11---1213# Configuration and troubleshooting1415Use this route when Brian2 cannot be imported, a package/compiler prerequisite16is unclear, a preference unexpectedly changes the code-generation or cache17configuration, or a log is needed to classify a failure. This route covers18Brian2 2.9.0 with Python >=3.12 and the `brian2` import root.1920## Route quickly21221. **Establish identity and baseline.** From the directory containing this23 sub-skill's bundled `scripts/` directory (or by passing that script's24 relative path), run `python scripts/check_brian2_env.py`. Confirm Python25 >=3.12, distribution `Brian2==2.9.0`, every declared base dependency and26 version constraint, and that an incomplete source checkout is not shadowing27 the intended installation. The checker is read-only and does not reveal28 executable or cache paths.292. **Repair installation before configuration.** Follow30 [installation](references/installation.md) in an isolated environment. Do31 not mix a checkout import with a separately installed distribution. If the32 checker reports a required import or version failure, fix that first and33 retest in a fresh interpreter.343. **Inspect effective preferences and cache state.** Read35 [preferences and cache](references/preferences-and-cache.md) before changing36 `prefs.codegen.target`, compiler settings, or Cython cache settings. The37 current-directory preference file overrides the user preference file.384. **Capture evidence and classify the first failure.** Use39 [troubleshooting](references/troubleshooting.md) to preserve the exception,40 Python/package versions, target, compiler names, relevant preferences, and41 Brian debug-log information before retrying or clearing a cache.425. **Choose the smallest validation.** A NumPy-target tiny model checks core43 Python execution. A Cython or C++ build is a separate native gate and can44 write cache/project files; run it only as an explicitly approved local45 check.4647## Scope and routing boundaries4849This route owns installation, importability, required package presence,50compiler/Cython prerequisite diagnosis, preference-file precedence and51validation, cache ownership/permissions, logging diagnostics, and generic52failure triage. It does **not** own detailed code-generation target selection,53generated-code APIs, standalone project design, model equations, scheduling,54or workflow-specific failures. After recording environment facts here, route55those details to [code-generation](../code-generation/SKILL.md),56[modeling](../modeling/SKILL.md),57[simulation-and-recording](../simulation-and-recording/SKILL.md),58[recording](../recording/SKILL.md),59[spatial-models](../spatial-models/SKILL.md), or60[units-and-equations](../units-and-equations/SKILL.md), respectively.6162Optional packages are capability boundaries, not automatic requirements:6364- SciPy is required for selected NumPy spatial/multicompartment operations;65 Matplotlib is for plotting; Pandas is for state import/export formats;66 IPython/Jupyter is for interactive notebooks; and `brian2tools` is a separate67 visualization/analysis package.68- GSL support means a native GSL installation with headers/libraries as well as69 Brian's integration; a Python import or library-name probe alone cannot prove70 it. Route GSL state-updater/code-generation use to code-generation.71- `pytest>=8` is the test extra needed by `brian2.test()`. A full test run is72 not the default response to a user-model failure.7374## Safety and acceptance7576- Do not install packages, use network commands, compile extensions, clear77 caches, delete standalone output, or edit preference files during a78 read-only diagnosis.79- Treat `import brian2` as necessary but insufficient: target, compiler,80 optional capability, cache access, and requested workflow need separate81 evidence.82- Treat an unknown version, failed required import, old Python, unavailable83 compiler for a compiled target, unreadable cache, invalid preference file,84 and unresolved optional native dependency as explicit unresolved limits.85- `brian2.test()` resets preferences while it runs and restores them afterward;86 use a narrow target/marker selection when diagnosing rather than launching87 the complete suite by default.8889## Bundled operating files9091- [installation.md](references/installation.md): package identity, baseline92 dependencies, pip/Conda installation, compiler prerequisites, and optional93 capability boundaries.94- [preferences-and-cache.md](references/preferences-and-cache.md): preference95 access, file syntax and precedence, effective target/cache inspection,96 cache-clearing safeguards, and NFS/process guidance.97- [troubleshooting.md](references/troubleshooting.md): install/import,98 compiler/Cython, optional dependency, configuration/data, API, logging, and99 workflow triage with routing boundaries.100- [check_brian2_env.py](scripts/check_brian2_env.py): non-mutating compact or101 JSON environment report. Use `--help` first; `--strict` gates required102 Python/package/import/version checks, and `--require-compiler` adds a103 compiler-name gate.104105The script reports compiler names and capability states, not local paths,106Python prefixes, or cache locations.