Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding python internal modules (cgi.py) to yocto image

Tags:

yocto

I am trying to add some python libraries to my custom image.
So far, I successfully added some libraries.

Some others, like sqlalchemy, was requiring some python internal module named “dummy_threading” and thus producing some error output stating "No module named ‘dummy_threading’ ".
I found out you can solve this issue by adding ‘python-threading’ to the image.

Unfortunately, I came across a similar issue with the ‘python-requests’ library, which cannot be imported throwing 'No module named ‘cgi’ ".

cgi.py seems to be a python internal module, much like ‘dummy_threading’, but I can’t find a way to include it to my image.
I already tried to add 'python-cgi' with no success.

Does anyone have a solution to this ?

Lucas

Additionnal info:
Yocto 1.7 (I cannot upgrade it to the newest)
Python 2.7.3

like image 596
Lucas Sorin Avatar asked Sep 25 '26 14:09

Lucas Sorin


1 Answers

Despite poky already contains maybe all what you need regarding python, as you mention, there are some internal parts of python which are provided in a different way.

A good idea to find out how to get what you miss is to inspect the manifest files. Such files can be found in your layers (basically poky and openembedded-core). For example, in poky is located in:

poky/meta/recipes-devtools/python/python-x.y-manifest.inc

If I check inside mine I can see:

FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* "

Notice the cgi. and the FILES_${PN}-netserver.

Finally that would mean that the package you need is actually "python-netserver".

like image 121
urnenfeld Avatar answered Sep 28 '26 21:09

urnenfeld



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!