代码之家  ›  专栏  ›  技术社区  ›  Ram Rachum

py2app错误:“'module'对象没有属性'symlink'”

  •  0
  • Ram Rachum  · 技术社区  · 15 年前

    我正在尝试用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)
    

    有人有主意吗?

    1 回复  |  直到 15 年前
        1
  •  1
  •   RichieHindle    15 年前

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

    py2app是Mac的-你是故意在Windows上运行它吗?你想用吗 py2exe ?