简体   繁体   English

py2app构建期间的语法错误

[英]syntax error during py2app build

New to programming (so please bear with me), but loving it so far. 编程新手(请耐心等待),但到目前为止仍然热爱它。 I coded a game using pygame and am having trouble compiling it as a stand-alone application using py2app. 我使用pygame编写了游戏代码,但无法使用py2app将其编译为独立应用程序。 I'm using Macports Python 2.7, though I tried switching back to the default Mac installation (2.7) as well as the default 2.6 and still get this error during the py2app build: 我使用的是Macports Python 2.7,尽管我尝试切换回默认的Mac安装(2.7)和默认的2.6,但在py2app构建期间仍然出现此错误:

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sympy/mpmath/libmp/exec_py3.py", line 1
    exec_ = exec
               ^
SyntaxError: invalid syntax

Exec_py3.py consists of all of one line: Exec_py3.py包含以下所有内容:

exec_ = exec

Just for laughs I commented it out and the py2app proceeded further along in the build but then choked here: 只是出于笑,我将其注释掉,然后py2app在构建中继续进行,但随后在这里here住了:

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 304, in synchronize_size
    raise ValueError("New Mach-O header is too large to relocate")
ValueError: New Mach-O header is too large to relocate

I don't know if the issues are related. 我不知道这些问题是否有关。 Py2app is working fine for a couple little test scripts I wrote that don't use pygame. Py2app对于我编写的一些不使用pygame的小测试脚本运行良好。 Any suggestions for what I can try next? 对我接下来可以尝试的任何建议吗?

Thanks! 谢谢!

edit - I found a couple of links that may be related, but can't really understand what's going on in the conversation. 编辑-我发现了几个可能相关的链接,但并不能真正理解对话中发生的事情。 Can anyone translate for a relative newby? 任何人都可以翻译为亲戚吗?

http://code.google.com/p/mpmath/issues/detail?id=204 http://code.google.com/p/mpmath/issues/detail?id=204

https://bitbucket.org/ronaldoussoren/py2app/issue/93/mach-o-header-may-be-too-large-to-relocate https://bitbucket.org/ronaldoussoren/py2app/issue/93/mach-o-header-may-be-too-large-to-relocate

Well, I found a workaround in case anybody else runs into this. 好吧,我发现了一个解决方法,以防其他人遇到此问题。 I uninstalled MacPorts and just used the Mac system Python (2.7). 我卸载了MacPorts,仅使用了Mac系统的Python(2.7)。 Everything then compiled fine. 然后一切都编译良好。 It was not enough just to use the port select command to switch to the system Python; 仅使用port select命令切换到系统Python是不够的。 I had to deinstall the whole thing. 我不得不卸载整个东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM