2017-08-15 3 views
3

J'ai utilisé Yocto pour construire et installer Python et python-twisted sur Ubuntu x86, Raspberry Pi, BeagleBone Black, et un TI AM57XX EVM (Dev Kit). Python-Twisted n'a aucun problème pour importer toutes les machines mentionnées ci-dessus à l'exception du kit de développement AM57XX. Il recrache l'erreur suivante sur:Comment faire Yocto construire Module fcntl dans le cadre de Python Build

Python 2.7.11 (default, Aug 7 2017, 12:07:27) 
[GCC 5.3.1 20160113] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from txdbus import client,error 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/usr/lib/python2.7/site-packages/txdbus/client.py", line 11, in <module> 
    from twisted.internet import defer, reactor 
    File "/usr/lib/python2.7/site-packages/twisted/internet/reactor.py", line 39, in <module> 
    File "/usr/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 405, in install 
    File "/usr/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 235, in __init__ 
    File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 498, in __init__ 
    File "/usr/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 289, in installWaker 
    File "/usr/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 139, in __init__ 
    File "/usr/lib/python2.7/site-packages/twisted/internet/fdesc.py", line 25, in setNonBlocking 
AttributeError: 'NoneType' object has no attribute 'fcntl' 

Si je lance Python sur la carte et essayez d'importer le module fcntl, il manque en effet:

Python 2.7.11 (default, Aug 7 2017, 12:07:27) 
[GCC 5.3.1 20160113] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> 
>>> import fcntl 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named fcntl 

Les listes de paquets sont les mêmes sur chaque machine . Qu'est-ce que je rate? Le noyau a-t-il besoin d'être configuré différemment?

Pendant que je recherche sur Google autour, j'ai trouvé ce post: https://lists.yoctoproject.org/pipermail/yocto/2013-May/013953.html

Il semble montrer que Python de Yocto a un problème et est mal configuré de sorte qu'il ne comprend pas le module fcntl:

>> ImportError: No module named fcntl 
>> ======== 
>> 
>> So it looks like the Python included with the SDK is crippled or mis-configured: 
> 
> Yeah, the Python we build is split up massively, so clearly the SDK is 
> missing the packages that are needed to run bitbake. But as I said, 
> using our SDK to build is over-complicating things as Ubuntu should 
> work fine. What problems were you seeing? 

Lorsque Yocto construit Python le script log.do_package mentionne les dépendances nécessaires pour python-fcntl - mais ils ne semblent pas comme des erreurs:

log.do_package:DEBUG: runstrip: 'arm-linux-gnueabihf-strip' --remove-section=.comment --remove-section=.note --strip-unneeded '/home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/package/usr/lib/python2.7/lib-dynload/fcntl.so' 
log.do_package:DEBUG: LIBNAMES: pkg python-fcntl libs 0 bins 0 sonames [] 
log.do_package:DEBUG: calculating shlib provides for python-fcntl 
log.do_package:DEBUG: LIBNAMES: pkg python-fcntl sonames [] 
log.do_package:DEBUG: calculating shlib requirements for python-fcntl 
log.do_package:DEBUG: python-fcntl: Dependency libpython2.7.so.1.0 requires package libpython2 (used by files: /home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/packages-split/python-fcntl/usr/lib/python2.7/lib-dynload/fcntl.so) 
log.do_package:DEBUG: python-fcntl: Dependency libc.so.6 requires package external-linaro-toolchain (used by files: /home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/packages-split/python-fcntl/usr/lib/python2.7/lib-dynload/fcntl.so) 
log.do_package.17147:DEBUG: runstrip: 'arm-linux-gnueabihf-strip' --remove-section=.comment --remove-section=.note --strip-unneeded '/home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/package/usr/lib/python2.7/lib-dynload/fcntl.so' 
log.do_package.17147:DEBUG: LIBNAMES: pkg python-fcntl libs 0 bins 0 sonames [] 
log.do_package.17147:DEBUG: calculating shlib provides for python-fcntl 
log.do_package.17147:DEBUG: LIBNAMES: pkg python-fcntl sonames [] 
log.do_package.17147:DEBUG: calculating shlib requirements for python-fcntl 
log.do_package.17147:DEBUG: python-fcntl: Dependency libpython2.7.so.1.0 requires package libpython2 (used by files: /home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/packages-split/python-fcntl/usr/lib/python2.7/lib-dynload/fcntl.so) 
log.do_package.17147:DEBUG: python-fcntl: Dependency libc.so.6 requires package external-linaro-toolchain (used by files: /home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/packages-split/python-fcntl/usr/lib/python2.7/lib-dynload/fcntl.so) 
log.do_populate_sysroot:DEBUG: runstrip: 'arm-linux-gnueabihf-strip' --remove-section=.comment --remove-section=.note --strip-unneeded '/home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/sysroot-destdir/usr/lib/python2.7/lib-dynload/fcntl.so' 
log.do_populate_sysroot.17148:DEBUG: runstrip: 'arm-linux-gnueabihf-strip' --remove-section=.comment --remove-section=.note --strip-unneeded '/home/me/am57xx/build/tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python/2.7.11-r1/sysroot-destdir/usr/lib/python2.7/lib-dynload/fcntl.so' 

Donc, je pense qu'il a construit le module mais ne pouvait pas l'empaqueter dans mon système de fichiers racine.

J'ai téléchargé la source Python et j'ai lancé configure avec "help" et j'ai recherché fcntl.

./configure --help | grep fcntl 

Cependant, il n'y a aucun résultat! Que puis-je faire pour déployer fcntl dans le système de fichiers racine de ma configuration Yocto ou de la recette Python?

+0

'./configure --help | grep fcntl' ne devrait pas donner de résultats. Vous pourriez 'cat configurer | grep fcntl' et 'chat setup.py | grep fcntl', mais je ne sais pas à quel point ce serait pertinent. Je sais squat à propos de _Yocto_, mais avez-vous accès aux logs de construction _Python_? Qu'en est-il du répertoire de construction (pour vérifier si _fcntl.so_ est présent)? – CristiFati

Répondre

0

Utilisez la dernière recette de Yocto pour construire le dernier Python 2.7.