GitHub user lgiammattei edited a comment on the discussion: Failing to install 
superset locally on a windows 11 pc in a python virtual environment

I was able to get Apache Superset up and running with Docker and WSL2, and get 
it working by accessing data from a DB2 for IBM i (aka AS/400). I thought I'd 
leave a few notes here that might be helpful to anyone else who might be 
interested in a similar work environment (whether for development or 
production).

I installed Superset in "dev mode" via Docker Compose (built from source), with 
the IBM i Access ODBC driver integrated so you can connect to Db2 for IBM i 
through the `sqlalchemy-ibmi` SQLAlchemy dialect.

## 1. Prerequisites
- [ ] Windows 10/11 with **WSL2** already installed and enabled (check with 
`wsl --status` in PowerShell)
- [ ] A Linux distribution installed in WSL2 (e.g. Ubuntu) — check with `wsl -l 
-v`, it must show `VERSION 2`
- [ ] **Docker Desktop** installed on Windows
- [ ] Access to an **IBM ID** to download the "IBM i Access Client Solutions" 
ODBC driver (Linux)
- [ ] Your Db2 for i connection details (host/IP, port, user, password, default 
library or `*LOCAL`)
- [ ] Git installed inside the WSL2 distribution (usually already present on 
Ubuntu; check with `git --version`)

---

## 2. Configure Docker Desktop to use WSL2

- [ ] Open Docker Desktop
- [ ] Go to **Settings (gear icon) > Resources > WSL Integration**
- [ ] Enable **"Enable integration with my default WSL distro"**
- [ ] Also enable the specific toggle next to your distro's name (e.g. Ubuntu)
- [ ] Click **Apply & Restart**
- [ ] Open a WSL2 terminal (from PowerShell: `wsl`, or open the "Ubuntu" app 
from the Start menu)
- [ ] Verify: `docker --version` should return a version number with no errors
- [ ] If you get `permission denied ... docker.sock`: close and reopen the WSL2 
session (this
      alone is often enough — the integration adds your user to the `docker` 
group, but a new
      session is required for it to take effect). If it persists: `sudo usermod 
-aG docker $USER`,
      then close and reopen the terminal again

---

## 3. Get the IBM i Access ODBC driver for Linux

- [ ] Log in to the IBM site (search for IBM i Access Client Solutions 
download) with your IBM ID
- [ ] The file you need to download is called **`IBMiAccess_v1r1_LinuxAP.zip`** 
(not a `.deb`
      directly — it's a zip archive that contains both the `.deb` and the 
`.rpm` packages inside it, e.g.
      `ibm-iaccess-1.1.0.29-1.0.amd64.deb`)
- [ ] Extract the zip and locate the `.deb` file inside it
- [ ] Copy the extracted `.deb` file **into WSL2** (no need to leave it on 
Windows): from the
      WSL2 shell, e.g. `cp /mnt/c/Users/<youruser>/Downloads/ibm-iaccess-*.deb 
~/`

---

## 4. Clone the Superset repository **inside WSL2** (not on C:\)

- [ ] Open the WSL2 terminal
- [ ] Create a working folder in the native Linux filesystem: `mkdir -p ~/dev 
&& cd ~/dev`
- [ ] Clone the official repository: `git clone 
https://github.com/apache/superset.git`
- [ ] Enter the folder: `cd superset`

## 5. Add the Db2 for i driver to the repository

- [ ] Create a folder for the driver: `mkdir -p ~/dev/superset/docker/vendor`
- [ ] Copy the downloaded `.deb` file: `cp ~/ibm-iaccess-*.deb 
~/dev/superset/docker/vendor/`
- [ ] Open the Dockerfile at the root of the repo: `~/dev/superset/Dockerfile`
- [ ] Find, in the **`dev` stage** (the one used by `docker-compose.yml` via
      `target: ${SUPERSET_BUILD_TARGET:-dev}`), the block that looks like:
      ```dockerfile
      # Debian libs needed for dev
      RUN /app/docker/apt-install.sh \
          git \
          pkg-config \
          default-libmysqlclient-dev
      ```
- [ ] Replace it with (adding `unixodbc`/`unixodbc-dev` and installing the IBM 
driver):
      ```dockerfile
      # Debian libs needed for dev
      RUN /app/docker/apt-install.sh \
          git \
          pkg-config \
          default-libmysqlclient-dev \
          unixodbc \
          unixodbc-dev

      # IBM i Access Client Solutions ODBC driver (for Db2 for i)
      COPY docker/vendor/ibm-iaccess-1.1.0.29-1.0.amd64.deb /tmp/ibm-iaccess.deb
      RUN /app/docker/apt-install.sh /tmp/ibm-iaccess.deb
      ```
      (adjust the exact `.deb` filename to match the version you downloaded)
- [ ] This block must come **before** the `USER superset` line in the same 
stage, otherwise
      the apt install will fail due to insufficient permissions
- [ ] Create (or edit) the file `~/dev/superset/docker/requirements-local.txt`, 
adding:
      ```
      pyodbc
      sqlalchemy-ibmi
      ```
      (this file is read automatically at runtime by `docker-bootstrap.sh` and 
installed via
      pip on every startup of the Python containers — no rebuild needed if you 
edit it later)

---

## 6. Build and start the stack

- [ ] From the repo root (`~/dev/superset`), build the Python services involved:
      ```
      docker compose build superset superset-init superset-worker 
superset-worker-beat
      ```
- [ ] Start the whole stack:
      ```
      docker compose up -d
      ```
- [ ] Follow the initialization logs:
      ```
      docker compose logs -f superset-init
      ```
      Wait for `Init Step 4/4 [Complete]` to appear and for the container to 
exit successfully
      (inside native WSL2 this typically takes 1-3 minutes, not more than 15)
- [ ] Check the status of all services: `docker compose ps` — everything should 
show `Up`
      (or `healthy` for `superset`/`superset-worker` after a minute or two)

---

## 7. First login

- [ ] Open your browser at `http://localhost` (port 80, via nginx) or 
`http://localhost:8088`
      (the Superset service's direct port)
- [ ] Log in with the default credentials: **admin / admin** (customizable in 
`docker/.env`
      or `docker/.env-local` via the `ADMIN_USERNAME`/`ADMIN_PASSWORD` 
variables)

---

## 8. Configure the Db2 for i connection

- [ ] Go to **Settings > Database Connections > + Database**
- [ ] If available, pick the **"IBM Db2 for i"** type from the preset list; 
otherwise choose
      **"Other"**
- [ ] Enter as the **SQLAlchemy URI**:
      ```
      ibmi://USER:PASSWORD@IBM_I_HOST/LIBRARY_NAME
      ```
      (omit `/LIBRARY_NAME` to use `*LOCAL`, the user's default library)
- [ ] Click **Test Connection** — you should see "Connection looks good"
- [ ] Save the connection
- [ ] Verify with a test query in **SQL Lab**, e.g.:
      ```sql
      SELECT * FROM SCHEMANAME.TABLENAME FETCH FIRST 10 ROWS ONLY
      ```


GitHub link: 
https://github.com/apache/superset/discussions/43475#discussioncomment-18162885

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to