本文介绍了py2app错误:“'模块'对象没有属性'符号链接'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to pack my Python app with py2app. I'm running the setup.py I created, and I get this error:

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)

有人有主意吗?

推荐答案

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

os.symlink is only available on Unix and Unix-like operating systems (including the Mac), not Windows.

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

py2app is for the Mac - are you deliberately running it on Windows? Did you mean to use py2exe?

这篇关于py2app错误:“'模块'对象没有属性'符号链接'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 18:35