Live data from Hacker News

No Python interpreter? this simple RAT installs its own copy

isc.sans.edu

1–10 of 62 posts

Re: No Python interpreter? this simple RAT installs its own copy

#2
CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is quite pesky.

[0]: https://github.com/gogcom/galaxy-integrations-python-api

[1]: https://support.gog.com/hc/en-us/articles/360024812473-GOG-G...

Re: No Python interpreter? this simple RAT installs its own copy

#3
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

Shipping your own runtimes as part of heavy application isn't that unusual or limited to Python, especially in the Windows world.

For example, JetBrains ships its own Java runtime for all of its IDEs.

In fact, the Python world would be simplified if "ship your own runtime and env" as part of your final application was the norm. The Python runtime and stdlib by itself is like 20-30MB packaged up or something. For certain applications (especially media asset rich ones), that's not that significant.

Re: No Python interpreter? this simple RAT installs its own copy

#4
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

Pretty much every app that allows integrations in another language will bundle an interpreter. Maybe not on linux distros, but even there it can make sense due to version differences/bundled modules etc.

Re: No Python interpreter? this simple RAT installs its own copy

#5
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

Shipping your own runtimes as part of heavy application isn't that unusual or limited to Python, especially in the Windows world. For example, JetBrains ships its own Java runtime for all of its IDEs. In fact, the Python world would be simplified if "ship your own runtime and env" as part of your final application was the norm. The Python runtime and stdlib by itself is like 20-30MB packaged up or something. For cert…

"Omnia mea mecum porto". If it's a part of you, you can rely on it always be there when you need it.

Re: No Python interpreter? this simple RAT installs its own copy

#6
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

You can create binaries for python using https://www.pyinstaller.org/. I've used it well for Linux and mac. Haven't used it for Windows.

Re: No Python interpreter? this simple RAT installs its own copy

#7
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

> Packaging Python apps for distribution outside of a Python development context is quite pesky.

It's actually pretty easy, as long as you skip on the various tools meant to make it an "easy one click process resulting in just one .exe" (pyinstaller, cx_Freeze, py2exe etc.).

For Linux things are a little bit different, but you're probably okay as long as you use a very old system to build it (RHEL6/7, manylinux1/2014).

Re: No Python interpreter? this simple RAT installs its own copy

#8
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

Shipping your own runtimes as part of heavy application isn't that unusual or limited to Python, especially in the Windows world. For example, JetBrains ships its own Java runtime for all of its IDEs. In fact, the Python world would be simplified if "ship your own runtime and env" as part of your final application was the norm. The Python runtime and stdlib by itself is like 20-30MB packaged up or something. For cert…

CPython is ~7-8 MB zipped. Straight from the source: https://www.python.org/ftp/python/3.9.4/python-3.9.4-embed-a...

Re: No Python interpreter? this simple RAT installs its own copy

#9
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

I've done this before with pyinstaller, and it's pretty straightforward. This wasn't even for a customer-facing application, instead an internal utility that I had initially made to save myself time. The first time I tried to distribute it without bundling the interpreter and libraries, it took a full hour to get it mostly set up for 4 people. Sure, every problem from multiple conflicting python environments, to pip commands for using a firewall's proxy, to people not having used cmd before were all solvable problems. But at the end of the day, it was more straightforward to bundle it as a .exe, give people a file path, and tell them to double-click it.

Re: No Python interpreter? this simple RAT installs its own copy

#10
post #2

CD Projekt's GoG client has a feature where users can write Python extensions [0] for third party account integrations. To enable this, they ship an entire Python interpreter alongside the app binary [1]. I guess this kind of makes sense, it is way easier than having users manage their own `venv`s and other Python environment stuff. Packaging Python apps for distribution outside of a Python development context is qui…

Sublime Text has it bundled too. I think that makes more sense than hoping that things work with whatever the system version of Python might be.
Post reply on HN