1

我正在尝试用 py2app 打包我的 Python 应用程序。我正在运行我创建的 setup.py,但出现此错误:

Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py
", line 548, in _run
    self.run_normal()
  File "C:\Python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py
", line 619, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "C:\Python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py
", line 710, in create_binaries
    target, arcname, pkgexts, copyexts, target.script)
  File "C:\Python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py
", line 1067, in build_executable
    self.symlink('../../site.py', os.path.join(pydir, 'site.py'))
  File "C:\Python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py
", line 377, in symlink
    os.symlink(src, dst)
AttributeError: 'module' object has no attribute 'symlink'
> c:\python26\lib\site-packages\py2app-0.3.6-py2.6.egg\py2app\build_app.py(377)s
ymlink()
-> os.symlink(src, dst)

有人有想法吗?

4

1 回答 1

2

os.symlink仅在 Unix 和类 Unix 操作系统(包括 Mac)上可用,在 Windows 上不可用。

py2app 适用于 Mac - 您是否故意在 Windows 上运行它?你的意思是使用py2exe吗?

于 2009-08-05T22:51:38.233 回答