Skip to content

python-flask fails at runtime on Yocto/poky #138

@austin2479

Description

@austin2479

The flask application fails to start on poky. There are two methods of starting the main application:

root@qemux86-64:~# python -m flask run
Could not import runpy module
root@qemux86-64:~# flask run
Traceback (most recent call last):
  File "/usr/bin/flask", line 6, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

Python also fails to import the flask module:

>>> import flask
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/flask/__init__.py", line 21, in <module>
    from .app import Flask, Request, Response
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 35, in <module>
    from .logging import create_logger
  File "/usr/lib/python2.7/site-packages/flask/logging.py", line 12, in <module>
    import logging
ImportError: No module named logging

I'm using the master branch of poky and meta-openembedded, both up-to-date when this issue was created. My local.conf file was generated by the oe-init-build-env script and has the following line appended:

IMAGE_INSTALL_append = " python-flask"

My bblayers.conf file:

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /mnt/hdd/yocto/poky/meta \
  /mnt/hdd/yocto/poky/meta-poky \
  /mnt/hdd/yocto/poky/meta-yocto-bsp \
  /mnt/hdd/yocto/poky/meta-openembedded/meta-oe \
  /mnt/hdd/yocto/poky/meta-openembedded/meta-python \
  "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions