So I have a python app made up of multiple modules which i can run with the following:

set FLASK_APP=myApp:get_app 
flask run

which works fine on any machine I run it on. However, I want to now pack this into a single file which I can run. I've found pex which looks like it can solve my problem, but I can't get it working.

So far I've tried creating a .pex file with the requirements and the entry point but nothing happens when I run it. the pex construction line is:

pex --python-shebang='path/to/my/python' -r requirements.txt -e myApp:main -o myApp.pex

Where the main function runs:

def main():
    app = get_app()

however now when I run myApp.pex nothing happens, what am I doing wrong?

0 Answers