Gri*_*Mel 15 python linux ubuntu executable cx-freeze
整整一天,我一直在尝试在Ubuntu 14.04下编译cx-Freeze并且没有运气.所以我放弃了,决定在这里问专家.
是)我有的
我试过两种方法:
从源安装
sudo python3 setup.py install
Run Code Online (Sandbox Code Playgroud)
我得到了什么
许多
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'
Run Code Online (Sandbox Code Playgroud)
然后
collect2: error: ld returned 1 exit status
error: command 'i686-linux-gnu-gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
通过pip安装
sudo pip3 install cx-Freeze
Run Code Online (Sandbox Code Playgroud)
我得到了什么
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
错误:命令'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
Run Code Online (Sandbox Code Playgroud)
并在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
Run Code Online (Sandbox Code Playgroud)
所以,我希望你能帮我解决这个问题,非常感谢:)
Gri*_*Mel 14
在setup.py字符串中
if not vars.get("Py_ENABLE_SHARED", 0):
Run Code Online (Sandbox Code Playgroud)
替换为
if True:
Run Code Online (Sandbox Code Playgroud)
感谢Thomas K.
您需要下载源代码
sudo apt-get install python3-dev
sudo apt-get install libssl-dev
打开setup.py并更改该行
if not vars.get("Py_ENABLE_SHARED", 0):
至
if True:
python3 setup.py build
sudo python3 setup.py install
sudo apt-get install python-dev
sudo apt-get install libssl-dev
打开setup.py并更改该行
if not vars.get("Py_ENABLE_SHARED", 0):
至
if True:
python setup.py build
sudo python setup.py install