在Ubuntu上安装cx_Freeze会返回错误代码1

时间:2018-02-03 20:38:28

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

我无法在Ubuntu 16.04上安装cx_Freeze。

到目前为止,我已经尝试过:

python3.6 -m pip install cx_Freeze

返回错误:

i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-
prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -
Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c 
source/bases/Console.c -o build/temp.linux-i686-3.6/source/bases/Console.o
    creating build/lib.linux-i686-3.6/cx_Freeze/bases
    i686-linux-gnu-gcc -pthread build/temp.linux-i686-
3.6/source/bases/Console.o -L/usr/lib/python3.6/config-3.6m-i386-linux-gnu -
lpython3.6m -o build/lib.linux-i686-3.6/cx_Freeze/bases/Console -Xlinker -
export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lpthread -ldl -lutil -lm -
    lexpat -L/usr/lib -lz -lexpat -s
    /usr/bin/ld: cannot find -lz
    collect2: error: ld returned 1 exit status
    error: command 'i686-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-ornam5bd/cx-
Freeze/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record /tmp/pip-vq85qfab-record/install-
record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ornam5bd/cx-Freeze/

我也尝试添加sudo前缀,但它返回了同样的错误。

我也尝试从source进行安装,但这也是失败的(导致错误)。

我也读过类似的问题,其中没有一个对我有用:

https://askubuntu.com/questions/929168/how-to-install-cx-freeze-5-0-2-for-python-3-5-2/929405#929405

https://askubuntu.com/questions/462794/how-to-conveniently-install-cx-freeze-for-python-3

https://ubuntuforums.org/showthread.php?t=1721444

如何安装cx_Freeze 5.1.1?

0 个答案:

没有答案