# Installation

VS Code Aster needs the extension itself, a Python 3.10 or later for its language features, and (to run studies) a way to launch code_aster. The language server's libraries ship with the extension: there is nothing to `pip install` for editing.

## 1. Install the extension

### From the Marketplace

1. Open the Extensions view (`Ctrl+Shift+X` / `Cmd+Shift+X`).
2. Search for `VS Code Aster`.
3. Click **Install**.

Or from a terminal:

```bash
code --install-extension simvia.vs-code-aster
```

### From a .vsix file

For an offline machine, download `vs-code-aster-<version>.vsix` from the [releases page](https://github.com/simvia-tech/vs-code-aster/releases), then run **Extensions: Install from VSIX...** from the Command Palette and pick the file.

> WSL users: copy the `.vsix` into the WSL file system first, for example `cp /mnt/c/Users/<you>/Downloads/vs-code-aster-<version>.vsix ~/`.

## 2. Python

The language features (completion, hover, diagnostics, formatting) run on **any Python 3.10 or later**, including 3.14. Their libraries ship with the extension, so nothing is installed into your Python. The [mesh viewer](/mesh-viewer) and the [study generator](/study-generator) need no Python at all.

### How the interpreter is chosen

1. `vs-code-aster.pythonExecutablePath`, when you set it to anything other than the default `python3`.
2. The private environment created by earlier versions of the extension (`<globalStorage>/.venv`), when it exists.
3. Otherwise the extension looks for one: the `py` launcher on Windows, then `python3`, `python` and `python3.14` down to `python3.10`. It keeps the first one that is 3.10 or later.

The **Python** row of the [code_aster sidebar](/sidebar#setup) shows the interpreter in use and its version. Changing `pythonExecutablePath` restarts the language server on the new interpreter.

If no suitable Python is found, a message offers **Download Python** (python.org) and **Choose interpreter** (the setting). On Windows, the python.org installer adds the `py` launcher the extension looks for.

## 3. Guided setup

The first time in a session that you open a `.comm` or `.export` file, the extension checks what is missing and asks about each item in turn, in this order:

1. **Python**, only if no Python 3.10 or later was found (see above).
2. **ruff**, the `.comm` formatter. Asked only when `vs-code-aster.formatter` is `ruff`. Optional.
3. **Docker**. **Install Docker** opens the Docker installation guide. **I have code_aster** runs **Locate code_aster install (native, without cave)** instead (see [Using an existing install](#using-an-existing-code_aster-install)).
4. **cave**. On Linux and macOS, **Install** opens a terminal named `cave install` that runs the cave install script (it uses `sudo`), and **Show me the command** prints it instead. On Windows, **Open install instructions** opens the cave page.
5. **A code_aster version**. **Install version…** opens the version picker (see [code_aster versions](/versions)).

Each question also offers **Not now** (ask again next session) or **Don't ask again** (remembered). When the run alias is not cave (a native install), the chain stops after ruff, since Docker, cave and images are not needed.

To run the checks again at any time, use **Run code_aster setup checks** from the Command Palette. The **Setup** group of the [code_aster sidebar](/sidebar) shows the same checks permanently.

## 4. Running code_aster

The **Run** button executes `<aliasForRun> <file>.export`. Pick one of these setups.

### With cave (default)

[cave](https://github.com/simvia-tech/cave) runs code_aster from Docker images and switches between versions. With Docker and cave installed, install a version from the status bar chip or the sidebar's **Versions** group. The language server then reads the command catalog of that version, so completions and checks match what you run. See [code_aster versions](/versions).

### Using an existing code_aster install

If code_aster is already installed (native Linux build, Windows installer, cluster module), run **Locate code_aster install (native, without cave)** from the Command Palette and pick the installation folder. The installation root, its `lib/aster` folder or the `code_aster` package itself are all accepted. Two settings are written to your user settings:

- `vs-code-aster.aliasForRun`: the launcher, `<install>/bin/run_aster` (quoted when the path contains spaces).
- `vs-code-aster.asterCatalogPath`: the `code_aster` Python package of the install, the folder that contains `Cata/` (typically `<install>/lib/aster/code_aster`).

The language server restarts and reads the catalog of your install. With the Windows installer (default location `%LOCALAPPDATA%\code_aster`), the values are `<install>\bin\run_aster.bat` and `<install>\codeaster-dist\lib\aster\code_aster`.

You can also set both by hand. Any run alias that does not start with `cave` counts as a native install: the Docker, cave and image checks then show as "not needed".

### Without either

Editing still works: a bundled code_aster **16.7** catalog is used, and the status bar chip shows it with a warning.

## Video tutorials

- [Installing VS Code Aster on Linux](https://www.youtube.com/watch?v=hfgOAKXF4d8)
- [Installing and configuring VS Code Aster on Windows (native code_aster)](https://www.youtube.com/watch?v=-Nmcb2MnmHU)
