简体   繁体   中英

Convert a Python (3.5.2) File into an exe?

is there any surefire way to convert a Python (3.5.2) File into an exe? I have seen Pyinstaller, py2exe and cx_Freeze. cx_Freeze does not have a Python 3.5 version, only 3.4 so it isnt compatible. Py2exe works only for Python 2 and while I had some success with Pyinstaller, it returned an error relating to 9130 WARNING: hidden import "pygame._view" not found! (the only one as I can see).

The exe. file was created but malfunctioned and stopped working.

Any advice?

I used py2exe to convert python 3 files to exe files. I haven't tested with version 3.5 but this website says that this version of py2exe works with any python 3 versions.

  1. Download and install py2exe
  2. Navigate to your python folder.
  3. Create new text file called setup.
  4. Insert these commands: from distutils.core import setup
    import py2exe
    setup(console=['nameofyourpyfile.py'])
  5. Close the text file and open cmd.
  6. Navigate to your python folder using command cd.
  7. Enter this command: python setup.txt py2exe
  8. Press enter and your done navigate to folder called dist and find your exe file.
  9. If it doesn't work install program called pywin32 and try again. If pywin32 doesn't help then let me know I will help you for sure :D

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