How to convert Python to an exe file

I want to run a file created in Python on a PC that does not have Python. We will share the tools to solve such problems. It's an extended version of your own memo, so please be kind to us regarding the quality.

1. Environment construction

For command prompt

command prompt


pip install pyinstaller
For Anaconda prompts.

Anaconda prompt


conda install pyinstaller

2. Run

prompt


pyinstaller [file name].py --onefile

important point

--If you omit the input of --onefile in the last option, you will need multiple files in dist, which makes moving difficult. --Please note that you cannot do anything that requires input at a command prompt such as input.

Recommended Posts

How to convert Python to an exe file
[Python] How to convert db file to csv
[Python Kivy] How to create an exe file with pyinstaller
[Automation] Convert Python code into an exe file
How to convert JSON file to CSV file with Python Pandas
How to turn a .py file into an .exe file
How to convert an array to a dictionary with Python [Application]
[Python] How to output a pandas table to an excel file
How to read an Excel file (.xlsx) with Pandas [Python]
python3 How to install an external module
[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 convert a Python file to EXE (Recursion error supported)
How to install Python
How to install python
How to read a CSV file with Python 2/3
How to create a JSON file in Python
[Python] How to read excel file with pandas
Convert svg file to png / ico with Python
How to crop an image with Python + OpenCV
How to convert SVG to PDF and PNG [Python]
[Blender x Python] How to make an animation
[2020.8 latest] How to install Python
How to convert / restore a string with [] in python
[python] Convert date to string
How to install Python [Windows]
How to convert Python # type for Python super beginners: str
[Python] Convert list to Pandas [Pandas]
Convert HTML to text file
[Blender x Python] How to create an original object
[Python] How to use list 1
How to update Python Tkinter to 8.6
Backtrader How to import an indicator from another file
How to measure mp3 file playback time with python
How to convert floating point numbers to binary numbers in Python
How to use Python argparse
Convert Scratch project to Python
[Python] Convert Shift_JIS to UTF-8
Python: How to use pydub
How to convert a mel spectrogram back to a wav file
[Python] How to use checkio
PyInstaller memorandum Convert Python [.py] to [.exe] with 2 lines
How to run Notepad ++ Python
How to create an image uploader in Bottle (Python)
Procedure to exe python file from Ubunts environment construction
[Work efficiency] How to change file names in Python
How to change Python version
An introduction to Python Programming
python, php, ruby How to convert decimal numbers to n-ary numbers
How to convert Json file to CSV format or EXCEL format
How to develop in Python
[python] How to judge scalar
[Python] How to use input ()
Convert genbank file to gff file
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
Convert python 3.x code to python 2.x
How to use Python bytes