I tried to convert a Python file to EXE (Recursion error supported)

Installation of external libraries

A library is required to convert a Py file to EXE. Install with the following command.

$ pip install pyinstaller

To make it an exe, enter the following. -If you add onefile, it becomes one file, -–Noconsole hides the console. To add an option, enter the command as follows.

$pyinstaller python filename--onefile --noconsole

If successful, a new folder called dist will be created. The EXE file is saved.

It would be nice if this could be converted to EXE. It may fail with an error similar to the following:

Recursion error : maximum recursion depth exceeded

If the above error is displayed, retry by the following means.

First, a file called "filename.spec" is saved when pyinstaller is executed. After opening this with Notepad etc., add two lines as follows.

# -*- mode: python ; coding: utf-8 -*-
import sys #Postscript
sys.setrecursionlimit(10000) #Postscript
block_cipher = None

If I can add it, I open PowerShell and run pyinstaller, One point needs attention. Execute pyinstaller on the spec file you edited earlier, not on the py file.

$pyinstaller edited spec file.spec --onefile --noconsole

I think that it can be safely converted to EXE. The EXE file is newly created in a folder called dist.

Recommended Posts

I tried to convert a Python file to EXE (Recursion error supported)
How to convert Python to an exe file
I tried reading a CSV file using Python
I want to write to a file with Python
I tried to create a program to convert hexadecimal numbers to decimal numbers with python
Mayungo's Python Learning Episode 6: I tried to convert a character string to a number
I tried to touch the CSV file with Python
I tried to draw a route map with Python
I tried running python etc. from a bat file
I tried to implement a pseudo pachislot in Python
I want to randomly sample a file in Python
I tried to automatically generate a password with Python3
I tried to implement a one-dimensional cellular automaton in Python
[Markov chain] I tried to read a quote into Python.
I tried "How to get a method decorated in Python"
I tried to make a stopwatch using tkinter in python
I tried to divide the file into folders with Python
I tried to touch Python (installation)
I made a script in Python to convert a text file for JSON (for vscode user snippet)
I tried uploading / downloading a file to AWS S3 / Azure BlobStorage / GCP CloudStorage with Python
[5th] I tried to make a certain authenticator-like tool with python
[2nd] I tried to make a certain authenticator-like tool with python
I tried to make a regular expression of "amount" using Python
[Python] I tried to implement stable sorting, so make a note
I tried to make a regular expression of "time" using Python
[3rd] I tried to make a certain authenticator-like tool with python
[Python] A memo that I tried to get started with asyncio
I tried to create a list of prime numbers with python
I tried to make a regular expression of "date" using Python
I tried to implement a misunderstood prisoner's dilemma game in Python
I tried to make a periodical process with Selenium and Python
I tried to make a 2channel post notification application with Python
I tried to make a todo application using bottle with python
[4th] I tried to make a certain authenticator-like tool with python
[1st] I tried to make a certain authenticator-like tool with python
I made a library that adds docstring to a Python stub file.
I tried to create a linebot (implementation)
I tried to summarize Python exception handling
I tried to implement PLSA in Python
[Python] How to convert db file to csv
I tried to implement permutation in Python
I tried to create a linebot (preparation)
[Python] How to convert a 2D list to a 1D list
[Python] Convert csv file delimiters to tab delimiters
Convert psd file to png in Python
I tried to implement PLSA in Python 2
Python3 standard input I tried to summarize
I want to build a Python environment
I tried to implement ADALINE in Python
I tried a functional language with Python
I tried recursion with Python ② (Fibonacci sequence)
I tried to implement PPO in Python
I tried to make a Web API
[Python] I tried to calculate TF-IDF steadily
I tried to touch Python (basic syntax)
I made a configuration file with Python
Python: I tried to make a flat / flat_map just right with a generator
I wrote a code to convert quaternions to z-y-x Euler angles in Python
I tried to communicate with a remote server by Socket communication with Python.
I want to convert a table converted to PDF in Python back to CSV
I tried to make a traffic light-like with Raspberry Pi 4 (Python edition)