Initial build errors

Thomas Törnblom <thomas.tornblom@...>

I'm just starting up my IAR porting effort again and thought I would just build a simple out of the box project with the standard tools, but I'm immediately running into issues.

I'm on Ubuntu 18.04.4 LTS and have followed
thomasto@thomasto-VirtualBox:~/zephyrproject/zephyr$ west build -p auto -b stm32f746g_disco samples/basic/blinky
-- west build: build configuration:
       source directory: /home/thomasto/zephyrproject/zephyr/samples/basic/blinky
       build directory: /home/thomasto/zephyrproject/zephyr/build (created)
       BOARD: stm32f746g_disco (origin: command line)
-- west build: generating a build system
-- Zephyr version: 2.2.0-rc3
-- Found PythonInterp: /usr/bin/python (found suitable version "3.7.5", minimum required is "3.6")
-- Selected BOARD stm32f746g_disco
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'west'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/", line 5, in <module>
    from import Report
  File "/usr/lib/python3/dist-packages/apport/", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'west'
CMake Error at /home/thomasto/zephyrproject/zephyr/cmake/host-tools.cmake:26 (message):
  Unable to import west.version from '/usr/bin/python'
Call Stack (most recent call first):
  /home/thomasto/zephyrproject/zephyr/cmake/app/boilerplate.cmake:443 (include)
  CMakeLists.txt:4 (include)

-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -B/home/thomasto/zephyrproject/zephyr/build -S/home/thomasto/zephyrproject/zephyr/samples/basic/blinky -GNinja -DBOARD=stm32f746g_disco

Looks like I'm missing some step.



Thomas Törnblom, Product Engineer
IAR Systems AB
Box 23051, Strandbodgatan 1
SE-750 23 Uppsala, SWEDEN
Mobile: +46 76 180 17 80 Fax: +46 18 16 78 01
E-mail: thomas.tornblom@... Website:

Join { to automatically receive all group messages.