尝试使用python3安装cx_freeze - 错误消息

时间:2013-10-11 08:10:04

标签: python python-3.x cx-freeze

我正在尝试在Linux上安装cx_freeze和python 3,我收到了这条消息。有人可以向我解释一下吗?我认为这意味着找不到python.h,但我不确定如何纠正这个错误。

root@debian:/home/halo11/Code/MOXA/cx_Freeze-4.3.1# python3.1 setup.py build
adding base module named _abcoll
adding base module named _weakrefset
adding base module named abc
adding base module named codecs
adding base module named copyreg
adding base module named encodings
adding base module named encodings.aliases
adding base module named encodings.ascii
adding base module named encodings.big5
adding base module named encodings.big5hkscs
adding base module named encodings.charmap
adding base module named encodings.cp037
adding base module named encodings.cp1006
adding base module named encodings.cp1026
adding base module named encodings.cp1140
adding base module named encodings.cp1250
adding base module named encodings.cp1251
adding base module named encodings.cp1252
adding base module named encodings.cp1253
adding base module named encodings.cp1254
adding base module named encodings.cp1255
adding base module named encodings.cp1256
adding base module named encodings.cp1257
adding base module named encodings.cp1258
adding base module named encodings.cp424
adding base module named encodings.cp437
adding base module named encodings.cp500
adding base module named encodings.cp737
adding base module named encodings.cp775
adding base module named encodings.cp850
adding base module named encodings.cp852
adding base module named encodings.cp855
adding base module named encodings.cp856
adding base module named encodings.cp857
adding base module named encodings.cp860
adding base module named encodings.cp861
adding base module named encodings.cp862
adding base module named encodings.cp863
adding base module named encodings.cp864
adding base module named encodings.cp865
adding base module named encodings.cp866
adding base module named encodings.cp869
adding base module named encodings.cp874
adding base module named encodings.cp875
adding base module named encodings.cp932
adding base module named encodings.cp949
adding base module named encodings.cp950
adding base module named encodings.euc_jis_2004
adding base module named encodings.euc_jisx0213
adding base module named encodings.euc_jp
adding base module named encodings.euc_kr
adding base module named encodings.gb18030
adding base module named encodings.gb2312
adding base module named encodings.gbk
adding base module named encodings.hp_roman8
adding base module named encodings.hz
adding base module named encodings.idna
adding base module named encodings.iso2022_jp
adding base module named encodings.iso2022_jp_1
adding base module named encodings.iso2022_jp_2
adding base module named encodings.iso2022_jp_2004
adding base module named encodings.iso2022_jp_3
adding base module named encodings.iso2022_jp_ext
adding base module named encodings.iso2022_kr
adding base module named encodings.iso8859_1
adding base module named encodings.iso8859_10
adding base module named encodings.iso8859_11
adding base module named encodings.iso8859_13
adding base module named encodings.iso8859_14
adding base module named encodings.iso8859_15
adding base module named encodings.iso8859_16
adding base module named encodings.iso8859_2
adding base module named encodings.iso8859_3
adding base module named encodings.iso8859_4
adding base module named encodings.iso8859_5
adding base module named encodings.iso8859_6
adding base module named encodings.iso8859_7
adding base module named encodings.iso8859_8
adding base module named encodings.iso8859_9
adding base module named encodings.johab
adding base module named encodings.koi8_r
adding base module named encodings.koi8_u
adding base module named encodings.latin_1
adding base module named encodings.mac_arabic
adding base module named encodings.mac_centeuro
adding base module named encodings.mac_croatian
adding base module named encodings.mac_cyrillic
adding base module named encodings.mac_farsi
adding base module named encodings.mac_greek
adding base module named encodings.mac_iceland
adding base module named encodings.mac_latin2
adding base module named encodings.mac_roman
adding base module named encodings.mac_romanian
adding base module named encodings.mac_turkish
adding base module named encodings.mbcs
adding base module named encodings.palmos
adding base module named encodings.ptcp154
adding base module named encodings.punycode
adding base module named encodings.raw_unicode_escape
adding base module named encodings.shift_jis
adding base module named encodings.shift_jis_2004
adding base module named encodings.shift_jisx0213
adding base module named encodings.tis_620
adding base module named encodings.undefined
adding base module named encodings.unicode_escape
adding base module named encodings.unicode_internal
adding base module named encodings.utf_16
adding base module named encodings.utf_16_be
adding base module named encodings.utf_16_le
adding base module named encodings.utf_32
adding base module named encodings.utf_32_be
adding base module named encodings.utf_32_le
adding base module named encodings.utf_7
adding base module named encodings.utf_8
adding base module named encodings.utf_8_sig
adding base module named genericpath
adding base module named io
adding base module named linecache
adding base module named os
adding base module named posixpath
adding base module named stat
adding base module named string
adding base module named stringprep
adding base module named token
adding base module named tokenize
adding base module named traceback
adding base module named warnings
running build
running build_py
running build_ext
building 'cx_Freeze.util' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python3.1 -c source/util.c -o build/temp.linux-i686-3.1/source/util.o
source/util.c:6:20: error: Python.h: No such file or directory
source/util.c:413: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/util.c:427: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_ModuleMethods’
source/util.c:464: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/util.c: In function ‘initutil’:
source/util.c:498: warning: implicit declaration of function ‘Module_Initialize’
error: command 'gcc' failed with exit status 1
root@debian:/home/halo11/Code/MOXA/cx_Freeze-4.3.1# ^C
root@debian:/home/halo11/Code/MOXA/cx_Freeze-4.3.1# 

1 个答案:

答案 0 :(得分:1)

您应该安装 python开发包。该软件包包含Python头文件和构建Python扩展时所需的静态库。

如果您使用apt-get安装了Python,则可以使用以下命令安装python开发包(需要root权限):

apt-get install python3.1-dev