ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
341 stars 36 forks source link

py2app python symlink incompatible with virtualenv 20 #390

Open kainjow opened 2 years ago

kainjow commented 2 years ago

I’m still investigating this but it appears py2app’s python alias in the app bundle is incompatible with virtualenv 20 because a symlink to another symlink is not supported by virtualenv and it appears sys.path is missing all the virtualenv paths. This results in modules not importing that are in the virtualenv.

The python symlink is used to debug the app via its bundle so APIs dependent on the bundle work correctly.

Is there an alternative way to debug py2app bundles? It does work running the stub executable directly for non debug.

kainjow commented 2 years ago

I was able to use VSCode with debugpy to attach to the embedded Python. Seems to work well so far with the visual debugger. Next: how to strip out the debugpy code for release 🙂