简体   繁体   中英

How can I make portable python desktop application?

The requirement is to make an application portable, meaning no installer. I looked at py2exe and I am afraid I need to run install if I want to run it under Windows.

So my question is, can I make a portable python desktop application without any installation (all dependencies and libs are packaged), dragging from USB / CD will run it?

(This is critical because it's a headache for users to install C++ Run Time library...)

Thanks.

You can use this method with py2exe : http://www.py2exe.org/index.cgi/SingleFileExecutable

Basically, you use NSIS to package all of the required files and folders into a single executable. When you run it, the required files are expanded to a temporary directory, the executable is run, and when it exits, the temporary files are deleted automatically.

There is also an example that comes with py2exe which uses Inno Setup instead of NSIS to achieve the same result. It's installed to site-packages\\py2exe\\samples\\extending .

You can also fork Portable Python and modify to include your application and libraries you need. It runs from any drive/network location without installation and you can pick do you want 2.xx or 3.xx based Python core

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM