Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Python interpreter and the dependent packages with the application #146

Closed
TheHarold opened this issue Jul 17, 2019 · 10 comments
Closed

Comments

@TheHarold
Copy link

Hello,

I used Platypus on my mac to package a python based app. Which works fine on my machine where I've python 3.7.3 and all the packages are installed but it doesn't work on other Mac's where they don't have the interpreter and the dependencies.

Is there a way to package it with python interpreter and all the packages? I couldn't find anything from the documentation. Please help

Thanks

@nriley
Copy link

nriley commented Aug 18, 2019

At this point you may be better off using a Python specific packaging tool that does dependency resolution (e.g. py2app or PyInstaller).

@sveinbjornt
Copy link
Owner

Using a bundled interpreter is a feature planned for the next release (5.4).

@TheHarold
Copy link
Author

Thank you all for replying
Is there any anticipated time lines for the next release. I'm just trying to assess if I should use any other alternative for now.

@sveinbjornt
Copy link
Owner

I'll be able to get around to the next release early next year at the earliest.

@cylott
Copy link

cylott commented Oct 8, 2019

Is there a way to package it with python interpreter and all the packages? I couldn't find anything from the documentation. Please help

This can be done with 5.3 using a simple workaround.

Include your Python binary in the app's "Bundled Files." Write a small wrapper shell script to open your primary script with the bundled interpreter. Select this wrapper in Platypus when you create your app.

Example:

#!/bin/bash
./python myscript "$1"

@TheHarold
Copy link
Author

Thanks for replying @cylott!
I tried all possible ways I could think but I couldn't package the interpreter with Platypus. However for now I've ended up using PyInstaller but I still love Platypus for its simplicity & elegance. I hope this feature would become available soon. Maybe I can go back to Platypus for the next release.

@cylott
Copy link

cylott commented Dec 19, 2019

Thanks for replying @cylott!
I tried all possible ways I could think but I couldn't package the interpreter with Platypus. However for now I've ended up using PyInstaller but I still love Platypus for its simplicity & elegance. I hope this feature would become available soon. Maybe I can go back to Platypus for the next release.

Well, you would need a static binary. My only experience is with PHP, and that one's nearly impossible to package.

@jarrodparkes
Copy link

any updates on this @sveinbjornt ?

@sveinbjornt
Copy link
Owner

I don't really have much time to work on Platypus at the moment, but an interim solution would be to include both the Python script and a python environment in Bundled Files, and use a shell script to run it using the python interpreter binary.

@sveinbjornt
Copy link
Owner

Fixed in master. You can now specify a relative interpreter path (relative to the Resources directory of the application bundle). Just include the interpreter in Bundled Files and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants