[yocto] Adding Python support to build

Rich Bayliss richbayliss at gmail.com
Fri Jul 19 03:51:08 PDT 2013


I have added a recipe to my build which RDEPENDS_${PN} = "python".
Although the package doesn't "need" python to run, it exposes a Python
library which I would like to use on the system in a Python script.

When I build my image, which has IMAGE_INSTALL += "my-package" in its
recipe, I have got Python installed and can run "python" on the
command line. However, my package exposes a library which imports
"random" - and that import is failing:

root at raspberrypi:~# python
Python 2.7.3 (default, Jul 15 2013, 23:00:16)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named random
>>>


As an unrelated test, I added "package-managment" to my IMAGE_FEATURES
which added a lot of things, but also made "import random" work
successfully.

Am I missing something obvious?

--
Rich Bayliss



More information about the yocto mailing list