Adding python internal modules (cgi.py)

Hello,

I am trying to add some python libraries to my FX30S 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.

Does anyone have a solution to this ?

Lucas

Additionnal info:
FX30S firmware version R13
Python 2.7.3

We can suggest you to update python version.We have seen that in “poky/meta/recipes-devtools/python/python-3.3-manifest.inc” there is “+FILES_${PN}-netserver” through which it is taking python 3.3 version.PLease change to version python3.5 by updating FILES_${PN}-netserver to +FILES_${PN}-netserver="${libdir}/python3.5/cgi.* ${libdir}/python3.5/HTTPServer. ${libdir}/python3.5/SocketServer.* "
probably this might resolve “No module named ‘cgi’”.

Also, We observed that in meta-openembedded/meta-python/recipes-devtools/python/python-cython.inc there is no “python-distribute” in the “RDEPENDS_$PN” we can add and try the same

Thank you for your help !

Some python internal modules must be explicitly added to the image (as runtime dependencies for example).
As you mentioned, looking at poky/meta/recipes-devtools/python/python-X.Y-manifest.inc indicates what module contains what package.
In this case, adding python-netserver will make cgi.py available.
No need to upgrade the python version to 3.5, this will even work with python 2.

External reference : Adding python internal modules (cgi.py) to yocto image - Stack Overflow