Skip to contentSkip to conversation

Missing Python modules on target

DISCUSSION Jonatan Magnusson 4 participants 6 messages Mar 19, 2014 – Mar 20, 2014 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi

I am trying to use Python on my target.

I added ”python” to IMAGE_INSTALL. But then the "base64" module was not installed. Very well, I added ”python-modules” to IMAGE_INSTALL, and now "base64" was installed.

But now "wsgiref" was missing. As far as I can see the only modules and packages that are/can be installed are the ones listed in ”meta/recipes-devtool/python/python-2.7-manifest.inc” and ”wsgiref” is not mentioned there.

What to do?

Is ”wsgiref” left out because it is incompatible with Yocto for some reason? Or can I add it myself in some way? Is there perhaps a way to install *all* modules/packages of the Python standard library? Disk space is not a problem.

Regards,
Jonatan Magnusson

#1 lore raw
Quoted 13 lines · Jonatan Magnusson

I am trying to use Python on my target.

I added ”python” to IMAGE_INSTALL. But then the "base64" module was not installed.
Very well, I added ”python-modules” to IMAGE_INSTALL, and now "base64" was installed.

But now "wsgiref" was missing. As far as I can see the only modules and packages that are/can be
installed are the ones listed in ”meta/recipes-devtool/python/python-2.7-manifest.inc” and ”wsgiref” is not mentioned there.

Quoted 7 lines

What to do?

Is ”wsgiref” left out because it is incompatible with Yocto for some reason? Or can I add it myself in some way?
Is there perhaps a way to install *all* modules/packages of the Python standard library? Disk space is not a problem.

That's what python-modules is for. If it didn't include it, then it sounds like it wasn't built at all in the python build, so that's where you'd need to look, I'd think.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABcZANmUrLVHyJ-QkO=dw7KgkwF+dZq5XEUwqynSkE5CKWyV4g@mail.gmail.com

#4 lore raw

(I replied to Chris personal email by mistake. Our conversation is pasted below.)

I tried to investigate how the Python installer works, and there are still many parts I am not sure about.
But as far as I understand the manifest file (python-2.7-manifest.inc) *is* responsible for telling bitbake which Python modules to install. It contains a bunch of FILES_${PN}-<package> definitions like this:

FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* "

If I add "${libdir}/python2.7/wsgiref" to one of these and rebuild the image the module gets installed on the image. This solves my problem, but I wonder why it is not included by default?

Anyone who can shed som light on this?

Regards,
Jonatan Magnusson

2014-03-19 17:12 GMT+01:00 Chris Larson <[email protected]>:

Quoted 52 lines
Quoted 11 lines · Jonatan Magnusson

As far as I can see the manifest file is generated from "scripts/contrib/python/generate-manifest-2.7.py" and "wsgiref" is not mentioned in that file either.

There is nothing really to build in wsgiref. It's just a directory of .py files that should be copied to the image. And those files are also present in

"build/tmp-eglibc/work/i586-oe-linux/python/2.7.3-r0.3/image/usr/lib/python2.7".

If the wsgiref modules got installed by the python buildsystem in do_install, but the manifest didn't include it,l then we'd get warnings about unpackaged files. As we do not, it's not being installed for some reason, which leads me to believe that the upstream python buildsystem isn't installing it, as it's not enabled, but I'm not an expert on the python buildsystem. That's where I'd suggest looking. Check the python recipe's do_install, and then examine the python buildsystem to see how to verify that wsgiref is enabled for inclusion.

Also, the manifest generation script above links to this page:

Quoted 5 lines

http://www.vanille-media.de/site/index.php/projects/python-for-arm-linux/

... which links to ...

Quoted 7 lines

http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/python

... which has a "python-wsgiref_0.1.2.bb" file that is not included in Yocto it seems. I'm just getting started with Yocto, so I may get something wrong, but it
seems that perhaps some more python .bb-files should be transferred to Yocto?

It seems like that recipe is for a standalone pypi wsgiref, but it's included in python for 2.5+, I expect that recipe is a remnant of pre-2.5 python builds.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

#5 lore raw

Hi Jonatan,

I believe it should be in python-misc package, so if you add that to IMAGE_INSTALLS or as a RDEPEND of some other installed packaged it should work.

There's a section in python_2.7.3.bb which is a catch all for stuff not packaged by python-2.7-manifest:

# catch all the rest (unsorted)
PACKAGES += "${PN}-misc"
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"

Cheers,
Erik

Quoted 85 lines · Jonatan Magnusson

(I replied to Chris personal email by mistake. Our conversation is pasted below.)

I tried to investigate how the Python installer works, and there are still many parts I am not sure about.
But as far as I understand the manifest file (python-2.7-manifest.inc) *is* responsible for telling bitbake which Python modules to install. It contains a bunch of FILES_${PN}-<package> definitions like this:

FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* "

If I add "${libdir}/python2.7/wsgiref" to one of these and rebuild the image the module gets installed on the image. This solves my problem, but I wonder why it is not included by default?

Anyone who can shed som light on this?

Regards,
Jonatan Magnusson

2014-03-19 17:12 GMT+01:00 Chris Larson <[email protected]>:

Quoted 43 lines
Quoted 11 lines · Jonatan Magnusson

As far as I can see the manifest file is generated from "scripts/contrib/python/generate-manifest-2.7.py" and "wsgiref" is not mentioned in that file either.

There is nothing really to build in wsgiref. It's just a directory of .py files that should be copied to the image. And those files are also present in

"build/tmp-eglibc/work/i586-oe-linux/python/2.7.3-r0.3/image/usr/lib/python2.7".

If the wsgiref modules got installed by the python buildsystem in do_install, but the manifest didn't include it,l then we'd get warnings about unpackaged files. As we do not, it's not being installed for some reason, which leads me to believe that the upstream python buildsystem isn't installing it, as it's not enabled, but I'm not an expert on the python buildsystem. That's where I'd suggest looking. Check the python recipe's do_install, and then examine the python buildsystem to see how to verify that wsgiref is enabled for inclusion.

Quoted 6 lines

Also, the manifest generation script above links to this page:

http://www.vanille-media.de/site/index.php/projects/python-for-arm-linux/

... which links to ...

Quoted 7 lines

http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/python

... which has a "python-wsgiref_0.1.2.bb" file that is not included in Yocto it seems. I'm just getting started with Yocto, so I may get something wrong, but it
seems that perhaps some more python .bb-files should be transferred to Yocto?

Quoted 9 lines

It seems like that recipe is for a standalone pypi wsgiref, but it's included in python for 2.5+, I expect that recipe is a remnant of pre-2.5 python builds.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 8 lines
=============================================
Erik Botö
Senior Software Engineer
Pelagicore AB
Ekelundsgatan 4, 6tr, SE-411 18 Gothenburg, Sweden
Mobile: +46 (0)76 881 72 03
E-Mail: [email protected]
=============================================
#6 lore raw

Hi,

Thanks, but unfortunately it still doesn’t work... wsgiref does not get installed on the image.

Regards,
Jonatan

20 mar 2014 kl. 13:22 skrev Erik Botö <[email protected]>:

Quoted 39 lines

Hi Jonatan,

I believe it should be in python-misc package, so if you add that to IMAGE_INSTALLS or as a RDEPEND of some other installed packaged it should work.

There's a section in python_2.7.3.bb which is a catch all for stuff not packaged by python-2.7-manifest:

# catch all the rest (unsorted)
PACKAGES += "${PN}-misc"
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"

Cheers,
Erik

Quoted 21 lines · Jonatan Magnusson

(I replied to Chris personal email by mistake. Our conversation is pasted below.)

I tried to investigate how the Python installer works, and there are still many parts I am not sure about.
But as far as I understand the manifest file (python-2.7-manifest.inc) *is* responsible for telling bitbake which Python modules to install. It contains a bunch of FILES_${PN}-<package> definitions like this:

FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* "

If I add "${libdir}/python2.7/wsgiref" to one of these and rebuild the image the module gets installed on the image. This solves my problem, but I wonder why it is not included by default?

Anyone who can shed som light on this?

Regards,
Jonatan Magnusson

#7 lore raw
Quoted 5 lines · Jonatan Magnusson

Hi,

Thanks, but unfortunately it still doesn’t work... wsgiref does not get installed on the image.

is wsgiref part of core python or is it a external module extension. If its part of core python
and is not being built/packaged then file a bug in yocto bugzilla to track it. otherwise add
a recipe for it (if it already does not exist) and then add it to your image

Quoted 52 lines

Regards,
Jonatan

20 mar 2014 kl. 13:22 skrev Erik Botö <[email protected]>:

Quoted 13 lines

Hi Jonatan,

I believe it should be in python-misc package, so if you add that to IMAGE_INSTALLS or as a RDEPEND of some other installed packaged it should work.

There's a section in python_2.7.3.bb which is a catch all for stuff not packaged by python-2.7-manifest:

# catch all the rest (unsorted)
PACKAGES += "${PN}-misc"
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
Quoted 26 lines

Cheers,
Erik

Quoted 21 lines · Jonatan Magnusson

(I replied to Chris personal email by mistake. Our conversation is pasted below.)

I tried to investigate how the Python installer works, and there are still many parts I am not sure about.
But as far as I understand the manifest file (python-2.7-manifest.inc) *is* responsible for telling bitbake which Python modules to install. It contains a bunch of FILES_${PN}-<package> definitions like this:

FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* "

If I add "${libdir}/python2.7/wsgiref" to one of these and rebuild the image the module gets installed on the image. This solves my problem, but I wonder why it is not included by default?

Anyone who can shed som light on this?

Regards,
Jonatan Magnusson

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto