Python – py2app error: “‘module’ object has no attribute ‘symlink'”

macospy2apppython

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)

Anyone has an idea?

Best Answer

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

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

Related Topic