Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frozen application can't run #1864

Open
Brinfer opened this issue Feb 6, 2024 · 0 comments
Open

Frozen application can't run #1864

Brinfer opened this issue Feb 6, 2024 · 0 comments

Comments

@Brinfer
Copy link

Brinfer commented Feb 6, 2024

Description

I’m trying to distribute my python server that uses connexion with pyinstaller.

Unfortunately, the executable product not pyinstaller does not work. Of the first request an error 500 is issued while it is not in "normal" mode.

Expected behaviour

connexion should work once compile with PyInstaller as Flask.

Actual behaviour

There seems to be an error when instantiating blueprint.
Whatever the basic url, the same error comes back.

INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
  File "uvicorn/middleware/proxy_headers.py", line 84, in __call__
  File "connexion/middleware/main.py", line 497, in __call__
    self.app, self.middleware_stack = self._build_middleware_stack()
  File "connexion/middleware/main.py", line 338, in _build_middleware_stack
    app.add_api(
  File "connexion/apps/flask.py", line 141, in add_api
    self.app.register_blueprint(api.blueprint)
  File "flask/sansio/scaffold.py", line 46, in wrapper_func
  File "flask/sansio/app.py", line 599, in register_blueprint
  File "flask/sansio/blueprints.py", line 310, in register
ValueError: The name '/swagger' is already registered for a different blueprint. Use 'name=' to provide a unique name.
INFO:     127.0.0.1:56490 - "GET /swagger/ui/ HTTP/1.1" 500 Internal Server Error

Steps to reproduce

Create a simple project on the model of the example helloworld (helloworld.zip)
Run the pyinstaller command line:

pyinstaller\
    helloworld/__main__.py\
    --add-data helloworld/spec:spec\
    --collect-all connexion\
    --name helloworld\
    --onefile

and run the executable:

./dist/helloworld

Additional info:

Output of the commands:

  • python --version : 3.10.12
  • pip show connexion | grep "^Version\:" : 3.0.5
  • pyinstaller --version: 6.3.0
  • uvicorn --version : Running uvicorn 0.27.0.post1 with CPython 3.10.12 on Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant