Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.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/7/python-2.7/5.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
在Ubuntu18.04上交叉编译Python2.7 for ARM,缺少模块_Python_Python 2.7_Cross Compiling - Fatal编程技术网

在Ubuntu18.04上交叉编译Python2.7 for ARM,缺少模块

在Ubuntu18.04上交叉编译Python2.7 for ARM,缺少模块,python,python-2.7,cross-compiling,Python,Python 2.7,Cross Compiling,我遵循了名为“”的堆栈交换帖子中的指示。步骤很简单,python在目标上运行 但是,当我试图在目标上创建virtualenv时,它会抱怨缺少“\u struct”模块。一次搜索在reddit和python.org上发现了一个类似的问题。我遵循讨论,首先编译了本地python,然后是跨python。同样的问题仍然存在 最近有人在Ubuntu 18.04 x86_64主机上交叉编译过python 2.7版本吗?步骤的确切顺序是什么 顺便说一下,我知道stackoverflow网站上的其他帖子,例如,

我遵循了名为“”的堆栈交换帖子中的指示。步骤很简单,python在目标上运行

但是,当我试图在目标上创建virtualenv时,它会抱怨缺少“\u struct”模块。一次搜索在reddit和python.org上发现了一个类似的问题。我遵循讨论,首先编译了本地python,然后是跨python。同样的问题仍然存在

最近有人在Ubuntu 18.04 x86_64主机上交叉编译过python 2.7版本吗?步骤的确切顺序是什么


顺便说一下,我知道stackoverflow网站上的其他帖子,例如,和一些其他帖子。那些可能太过时了。我还遇到了一个示例,如果按原样使用,会出现很多错误

不确定这是否是正确的解决方案。我尝试将内容添加到
模块/Setup.local
。添加
\u struct
行后,原始错误消失了。最终使用如下文件:

# Edit this file for local setup changes

#*shared*

#readline readline.c -lreadline -ltermcap


# Modules that should always be present (non UNIX dependent):

array arraymodule.c    # array objects
cmath cmathmodule.c _math.c # -lm # complex math library functions
math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
_struct _struct.c      # binary structure packing/unpacking
time timemodule.c # -lm # time operations and variables
operator operator.c    # operator.add() and similar goodies
#_testcapi _testcapimodule.c    # Python C API test module
_random _randommodule.c        # Random number generator
_collections _collectionsmodule.c # Container types
_heapq _heapqmodule.c          # Heapq type
itertools itertoolsmodule.c    # Functions creating iterators for efficient looping
strop stropmodule.c            # String manipulations
_functools _functoolsmodule.c  # Tools for working with functions and callable objects
_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
#_pickle _pickle.c      # pickle accelerator
datetime datetimemodule.c      # date/time type
_bisect _bisectmodule.c        # Bisection algorithms

unicodedata unicodedata.c    # static Unicode character database

# access to ISO C locale support
#_locale _localemodule.c  # -lintl

# Standard I/O baseline
_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c


# added due to missing for virtualenv:
binascii binascii.c
cStringIO cStringIO.c
cPickle cPickle.c


# Modules with some UNIX dependencies -- on by default:

fcntl fcntlmodule.c    # fcntl(2) and ioctl(2)
spwd spwdmodule.c              # spwd(3)
grp grpmodule.c                # grp(3)
select selectmodule.c  # select(2); not on ancient System V

# Memory-mapped files (also works on Win32).
mmap mmapmodule.c

# CSV file helper
_csv _csv.c

# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c


# Some more UNIX dependent modules -- off by default, since these
# are not supported by all UNIX systems:

#nis nismodule.c -lnsl  # Sun yellow pages -- not everywhere
termios termios.c      # Steen Lumholt's termios module
resource resource.c    # Jeremy Hylton's rlimit interface


# Note that the _md5 and _sha modules are normally only built if the
# system does not have the OpenSSL libs containing an optimized version.

# The _md5 module implements the RSA Data Security, Inc. MD5
# Message-Digest Algorithm, described in RFC 1321.  The necessary files
# md5.c and md5.h are included here.

_md5 md5module.c md5.c


# The _sha module implements the SHA checksum algorithms.
# (NIST's Secure Hash Algorithms.)
_sha shamodule.c
_sha256 sha256module.c
_sha512 sha512module.c


# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

要包含zlib,需要交叉编译zlib。看见那里的台阶很好用。