Pipenv Pyinstaller
April 24, 2021
Create a basic hello world
using flask:
mkdir /tmp/project
cd /tmp/project
Create app.py
:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return 'Hello World!'
if __name__ == '__main__':
app.run(host='0.0.0.0')
Instal flask:
pipenv install flask
test the app:
pipenv shell
python app.py
Install pyinstaller
:
pipenv install pyinstaller
Create the requirements.txt
:
pipenv run pip freeze > requirements.txt
Create the binary:
pyinstaller --onefile app.py
Test & run:
./dist/app
Done :-)