gpt4 book ai didi

python - Ubuntu下编译Cx-Freeze

转载 作者:IT王子 更新时间:2023-10-29 00:23:47 25 4
gpt4 key购买 nike

一整天,我一直在尝试在 Ubuntu 14.04 下编译 cx-Freeze,但没有成功。所以我放弃了,决定在这里请教专家。

我有什么

  1. Ubuntu 14.04
  2. python 3.4
  3. 已安装 python-dev、python3-dev、python3.4-dev(我知道这个常见问题)
  4. cx-Freeze 4.3.3 的来源

我尝试了两种方式:

  1. 从源安装
  2. 通过 pip 安装

从源安装

sudo python3 setup.py install

我得到了什么

很多

MyPath/cx_Freeze-4.3.3/source/bases/Console.c:24: undefined reference to `PyErr_Print'
MyPath/cx_Freeze-4.3.3/source/bases/Console.c:24: undefined reference to `Py_FatalError'

然后

collect2: error: ld returned 1 exit status
error: command 'i686-linux-gnu-gcc' failed with exit status 1

通过 pip 安装

sudo pip3 install cx-Freeze

我得到了什么

collect2: error: ld returned 1 exit status

错误:命令“i686-linux-gnu-gcc”失败,退出状态为 1

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cx-Freeze/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c954v7x6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cx-Freeze
Storing debug log for failure in /home/grimel/.pip/pip.log

在 pip.log 中

Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python3/dist-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cx-Freeze/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c954v7x6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cx-Freeze

所以,我希望你能帮助我解决这个问题,我会非常感激:)

最佳答案

setup.py字符串中

if not vars.get("Py_ENABLE_SHARED", 0):

替换为

if True:

感谢Thomas K

关于python - Ubuntu下编译Cx-Freeze,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25107697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com