Solution: python3 cannot run after being packaged into exe using cx_Freeze, python3cx_freeze

Source: Internet
Author: User

Solution: python3 cannot run after being packaged into exe using cx_Freeze, python3cx_freeze

I am using python3.4. After packaging cx_Freeze into exe, I find that some programs can run after packaging, but some cannot run.

This is a console Error


Multiple parties found that some python extension packages were missing in windows.

As shown in:


You only need to download the corresponding extension package and install it to pack it into an exe and run it correctly.

Expansion package: http://www.lfd.uci.edu /~ Gohlke/pythonlibs/


The python3 file cannot be run after being packaged into an exe using cx_Freeze?

Blog.csdn.net/..527981

Package python into exe

Return should be placed in a function,

There are many programs that package python into exe, such as py2exe and PyInstaller. But so far, they do not support python3.1, so here I will introduce cx_freeze 4.2.2, it also supports cross-platform and can run on windows and linux.
The download URL of cx_freeze is sourceforge.net/projects/cx-freeze/files/. Select the python version you have installed. For example, I am using python3.1, so I need to download the cx_Freeze-4.2.2.win32-py3.1.msi file. After running the installation package, the program will be copied to the python directory. There are two main scenarios: C:/Python31/Scripts and C:/Python31/Lib/site-packages/cx_Freeze.

In earlier versions of cx_Freeze, FreezePython is used. the py script converts py to exe, and in version 4.2.2, FreezePython. py is gone, and the main work is handed over to cxfreeze in C:/Python31/Scripts. bat to complete.
There are two main methods to package an exe using cx_Freeze:
First, run cxfreeze. bat directly through:
First enter the cmd command line, enter the C:/Python31/Scripts directory, and then run cxfreeze. bat-h to see its usage instructions. We can use cx_freeze's own sample for a test.
Go to c:/python31/scripts/and run
Cxfreeze C:/Python31/Lib/site-packages/cx_Freeze/samples/PyQt4/PyQt4app. py -- install-dir = d:/123
Pytqt4app. py will be packaged into exe, and the library files used by it will also be included in the d:/123 directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.