2016年8月30日 星期二

【Ubuntu】安裝cx_Freeze會出現 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1.

因為要把寫好的Python的程式碼打包,需要安裝cx_Freeze,按照官網的安裝方式:
    pip install cx_Freeze

會出現錯誤訊息:
    adding base module named StringIO
    adding base module named StringIO
    adding base module named UserDict
    adding base module named _abcoll
    adding base module named _weakrefset
    adding base module named abc
    adding base module named base64
    adding base module named codecs
    adding base module named copy
    adding base module named copy_reg
    adding base module named encodings
    adding base module named encodings.aliases
    adding base module named encodings.ascii
    adding base module named encodings.base64_codec
    adding base module named encodings.big5
    adding base module named encodings.big5hkscs
    adding base module named encodings.bz2_codec
    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.cp720
    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.cp858
    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.hex_codec
    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.quopri_codec
    adding base module named encodings.raw_unicode_escape
    adding base module named encodings.rot_13
    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.string_escape
    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 encodings.uu_codec
    adding base module named encodings.zlib_codec
    adding base module named genericpath
    adding base module named linecache
    adding base module named ntpath
    adding base module named os
    adding base module named posixpath
    adding base module named quopri
    adding base module named repr
    adding base module named stat
    adding base module named string
    adding base module named stringprep
    adding base module named struct
    adding base module named traceback
    adding base module named types
    adding base module named warnings
    adding base module named weakref
    running install
    running build
    running build_py
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/windist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/dist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/freezer.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/__init__.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/setupwriter.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/common.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/finder.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/hooks.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/main.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    copying cx_Freeze/macdist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
    creating build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/SharedLib.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/Console.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/ConsoleSetLibPath.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/SharedLibSource.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/ConsoleKeepPath.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/advanced_1.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/advanced_2.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
    copying cx_Freeze/samples/zope/qotd.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
    copying cx_Freeze/samples/zope/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
    copying cx_Freeze/samples/wx/wxapp.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
    copying cx_Freeze/samples/wx/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
    copying cx_Freeze/samples/Tkinter/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
    copying cx_Freeze/samples/Tkinter/SimpleTkApp.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
    copying cx_Freeze/samples/relimport/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
    copying cx_Freeze/samples/relimport/relimport.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
    copying cx_Freeze/samples/simple/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
    copying cx_Freeze/samples/simple/hello.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
    copying cx_Freeze/samples/PyQt4/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
    copying cx_Freeze/samples/PyQt4/PyQt4app.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/matplotlib
    copying cx_Freeze/samples/matplotlib/matplotlib_eg.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/matplotlib
    copying cx_Freeze/samples/matplotlib/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/matplotlib
    creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/ServiceHandler.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/Config.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
    running build_ext
    building 'cx_Freeze.util' extension
    creating build/temp.linux-x86_64-2.7/source
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/util.c -o build/temp.linux-x86_64-2.7/source/util.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/source/util.o -o build/lib.linux-x86_64-2.7/cx_Freeze/util.so
    creating build/temp.linux-x86_64-2.7/source/bases
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibuild/temp.linux-x86_64-2.7 -I/usr/include/python2.7 -c source/bases/Console.c -o build/temp.linux-x86_64-2.7/source/bases/Console.o
    creating build/lib.linux-x86_64-2.7/cx_Freeze/bases
    x86_64-linux-gnu-gcc -pthread build/temp.linux-x86_64-2.7/source/bases/Console.o -o build/lib.linux-x86_64-2.7/cx_Freeze/bases/Console -s
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 GetImporterHelper:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:221: 未定義參考到「PyObject_CallMethod」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:225: 未定義參考到「PyErr_Clear」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 GetDirName:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:76: 未定義參考到「PyString_FromStringAndSize」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 SetExecutableName:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:103: 未定義參考到「PyString_FromString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:125: 未定義參考到「PyString_FromStringAndSize」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:146: 未定義參考到「PyString_FromString」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 SetExecutableName:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:165: 未定義參考到「PyString_FromString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:177: 未定義參考到「PyString_FromString」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 SetExecutableName:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:112: 未定義參考到「PyExc_OSError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:112: 未定義參考到「PyErr_SetFromErrnoWithFilename」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 main:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:64: 未定義參考到「Py_NoSiteFlag」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:65: 未定義參考到「Py_FrozenFlag」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:66: 未定義參考到「Py_IgnoreEnvironmentFlag」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:67: 未定義參考到「PyImport_FrozenModules」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:93: 未定義參考到「Py_SetPythonHome」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:95: 未定義參考到「Py_SetProgramName」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:96: 未定義參考到「Py_GetProgramFullPath」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:97: 未定義參考到「Py_Initialize」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:98: 未定義參考到「PySys_SetArgv」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 SetPathToSearch:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:196: 未定義參考到「PySys_GetObject」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:199: 未定義參考到「PyList_Insert」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:201: 未定義參考到「PyList_Insert」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:203: 未定義參考到「PyList_Insert」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:205: 未定義參考到「PyList_Insert」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 GetImporter:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:241: 未定義參考到「PyImport_ImportModule」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 ExecuteScript:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:305: 未定義參考到「PyDict_New」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 PopulateInitScriptDict:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:266: 未定義參考到「PyEval_GetBuiltins」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:266: 未定義參考到「PyDict_SetItemString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:268: 未定義參考到「PyDict_SetItemString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:270: 未定義參考到「PyDict_SetItemString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:272: 未定義參考到「PyDict_SetItemString」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:275: 未定義參考到「PyDict_SetItemString」
    build/temp.linux-x86_64-2.7/source/bases/Console.o:/tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:278: 跟著更多未定義的參考到「PyDict_SetItemString」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 ExecuteScript:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:313: 未定義參考到「PyObject_CallMethod」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Common.c:317: 未定義參考到「PyEval_EvalCode」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 main:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:105: 未定義參考到「Py_Finalize」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:24: 未定義參考到「PyErr_Print」
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:25: 未定義參考到「Py_FatalError」
    build/temp.linux-x86_64-2.7/source/bases/Console.o: 於函式 FatalScriptError:
    /tmp/pip-build-DRynWy/cx-Freeze/source/bases/Console.c:36: 未定義參考到「PyErr_Print」
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

後來我按照這篇教學文章走,跑去官網下載Source回來


然後解壓縮後,打開 setup.py,尋找:
    if not vars.get("Py_ENABLE_SHARED", 0):

取代:
    if True:

再執行安裝
    sudo python setup.py install

又出現錯誤訊息(以下簡略....):
    ctions -lpthread -ldl -lutil -lm -L/usr/lib -lz -s
    /usr/bin/ld: 找不到 -lz
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

安裝zlib1g-dev套件:
    sudo apt-get install -y zlib1g-dev

再次執行安裝:
    sudo python setup.py install

終於成功了~

沒有留言:

張貼留言