2.3 Install Python Dependencies and Get Zephyr Source

  1. Install Python “venv” package.

    $ sudo apt install python3-venv

  2. Create a new virtual environment.

    $ python3 -m venv ~/zephyrproject/.venv

  3. Activate the virtual environment.

    $ source ~/zephyrproject/.venv/bin/activate

    Note: Remember to activate the virtual environment every time you start working.
  4. Install “west”.

    $ pip install west

  5. Get the Zephyr source code.
    1. $ west init ~/zephyrproject

    2. $ cd ~/zephyrproject

    3. $ west update

  6. Export a Zephyr CMake package.

    $ west zephyr-export

  7. Install the dependencies using pip.

    $ pip install -r ~/zephyrproject/zephyr/scripts/requirements.txt