Open the terminal inside your project folder.
Run:
python3 -m venv venvThis creates a folder named venv containing the environment files.
On macOS / Linux:
source venv/bin/activateOn Windows CMD:
venv\Scripts\activateOn Windows PowerShell:
venv\Scripts\Activate.ps1After activation, you will see (venv) at the beginning of the command line.
Once the environment is active, install the required packages:
pip install -r requirements.txtBefore running the EEG recorder, you must identify the OpenBCI USB dongle port.
- Plug in the OpenBCI USB Dongle.
- Open Terminal.
- Run:
ls /dev/cu.*You should see something similar to:
/dev/cu.usbserial-DP04W01L
This is the serial port.
Use this value in the app:
/dev/cu.usbserial-DP04W01L
- Always prefer
/dev/cu.*over/dev/tty.*on macOS. - If nothing appears, unplug and re-plug the dongle and run the command again.
- Do not run OpenBCI GUI at the same time.
With the environment activated:
streamlit run app.py(Replace app.py with your script name.)
When done, type:
deactivateto exit the virtual environment and return to the system Python.
- All packages installed inside the environment are isolated from the system.
- Each time you open a new terminal to run your project, activate the environment first.
- The serial port name may change if you use a different USB hub or device.