Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将Yocto构建模块fcntl作为Python构建的一部分_Python_Linux_Python 2.7_Twisted_Twisted.internet - Fatal编程技术网

如何将Yocto构建模块fcntl作为Python构建的一部分

如何将Yocto构建模块fcntl作为Python构建的一部分,python,linux,python-2.7,twisted,twisted.internet,Python,Linux,Python 2.7,Twisted,Twisted.internet,我使用Yocto在Ubuntu x86、Raspberry Pi、BeagleBone Black和TI AM57XX EVM(开发工具包)上构建和安装Python和Python twisted。Python Twisted导入除AM57XX开发工具包之外的所有上述机器没有问题。它会抛出以下错误: Python 2.7.11 (default, Aug 7 2017, 12:07:27) [GCC 5.3.1 20160113] on linux2 Type "help", "copyrigh

我使用Yocto在Ubuntu x86、Raspberry Pi、BeagleBone Black和TI AM57XX EVM(开发工具包)上构建和安装Python和Python twisted。Python Twisted导入除AM57XX开发工具包之外的所有上述机器没有问题。它会抛出以下错误:

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'
Yocto构建Python时,log.do_包脚本会提到Python fcntl所需的依赖项,但它们看起来不像是错误:

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'
因此,我认为它构建了模块,但无法将其打包到我的根文件系统中

我下载了Python源代码,运行带有“help”的configure并搜索fcntl

./configure --help | grep fcntl
但是,没有结果


为了将fcntl部署到根文件系统,我可以对我的Yocto配置或Python配方做些什么

使用Yocto的最新配方来构建最新的Python 2.7。

这是一个旧线程,但我必须上下搜索这个主题才能解决它

在我的Yocto“poky”版本中,fcntl位于目标设备上

/usr/lib/python2.7/lib-dynload/fcntl.so
Yocto重新安排并删除了一些python模块以节省空间,包括我的发行版上的子流程和fcntl

要添加它,请找到创建图像的任何bb/inc文件,添加以下内容

IMAGE_INSTALL_append = " python-fcntl "
然后重建rootfs或最终图像。该文件应显示在

./build/tmp/.../rootfs/usr/lib/python2.7/lib-dynload/fcntl.so
您可以将此文件复制到目标计算机进行测试。

/code>/configure--help | grep fcntl不应产生任何结果。您可以
cat configure | grep fcntl
cat setup.py | grep fcntl
,但我不知道这有多重要。我了解Yocto,但您有权访问Python构建日志吗?构建目录如何(检查是否存在fcntl.so)?
IMAGE_INSTALL_append = " python-fcntl "
./build/tmp/.../rootfs/usr/lib/python2.7/lib-dynload/fcntl.so