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

cannot import name 'url_quote' from 'werkzeug.urls' when starting launch.bat after running setup-amd.bat #414

Closed
sz1kormar opened this issue Nov 23, 2023 · 8 comments
Assignees
Labels
scope/api status/fixed issues that have been fixed and released type/bug broken features
Milestone

Comments

@sz1kormar
Copy link

"Launching API server..."
D:\onnx-web\api\onnx_web\diffusers\pipelines\upscale.py:14: FutureWarning: Importing DiffusionPipeline or ImagePipelineOutput from diffusers.pipeline_utils is deprecated. Please import from diffusers.pipelines.pipeline_utils instead.
from diffusers.pipeline_utils import ImagePipelineOutput
Error: Bad module 'onnx_web.main'

Usage:

waitress-serve [OPTS] MODULE:OBJECT

Standard options:

--help
    Show this information.

--call
    Call the given object to get the WSGI application.

--host=ADDR
    Hostname or IP address on which to listen, default is '0.0.0.0',
    which means "all IP addresses on this host".

    Note: May not be used together with --listen

--port=PORT
    TCP port on which to listen, default is '8080'

    Note: May not be used together with --listen

--listen=ip:port
    Tell waitress to listen on an ip port combination.

    Example:

        --listen=127.0.0.1:8080
        --listen=[::1]:8080
        --listen=*:8080

    This option may be used multiple times to listen on multiple sockets.
    A wildcard for the hostname is also supported and will bind to both
    IPv4/IPv6 depending on whether they are enabled or disabled.

--[no-]ipv4
    Toggle on/off IPv4 support.

    Example:

        --no-ipv4

    This will disable IPv4 socket support. This affects wildcard matching
    when generating the list of sockets.

--[no-]ipv6
    Toggle on/off IPv6 support.

    Example:

        --no-ipv6

    This will turn on IPv6 socket support. This affects wildcard matching
    when generating a list of sockets.

--unix-socket=PATH
    Path of Unix socket. If a socket path is specified, a Unix domain
    socket is made instead of the usual inet domain socket.

    Not available on Windows.

--unix-socket-perms=PERMS
    Octal permissions to use for the Unix domain socket, default is
    '600'.

--url-scheme=STR
    Default wsgi.url_scheme value, default is 'http'.

--url-prefix=STR
    The ``SCRIPT_NAME`` WSGI environment value.  Setting this to anything
    except the empty string will cause the WSGI ``SCRIPT_NAME`` value to be
    the value passed minus any trailing slashes you add, and it will cause
    the ``PATH_INFO`` of any request which is prefixed with this value to
    be stripped of the prefix.  Default is the empty string.

--ident=STR
    Server identity used in the 'Server' header in responses. Default
    is 'waitress'.

Tuning options:

--threads=INT
    Number of threads used to process application logic, default is 4.

--backlog=INT
    Connection backlog for the server. Default is 1024.

--recv-bytes=INT
    Number of bytes to request when calling socket.recv(). Default is
    8192.

--send-bytes=INT
    Number of bytes to send to socket.send(). Default is 18000.
    Multiples of 9000 should avoid partly-filled TCP packets.

--outbuf-overflow=INT
    A temporary file should be created if the pending output is larger
    than this. Default is 1048576 (1MB).

--outbuf-high-watermark=INT
    The app_iter will pause when pending output is larger than this value
    and will resume once enough data is written to the socket to fall below
    this threshold. Default is 16777216 (16MB).

--inbuf-overflow=INT
    A temporary file should be created if the pending input is larger
    than this. Default is 524288 (512KB).

--connection-limit=INT
    Stop creating new channels if too many are already active.
    Default is 100.

--cleanup-interval=INT
    Minimum seconds between cleaning up inactive channels. Default
    is 30. See '--channel-timeout'.

--channel-timeout=INT
    Maximum number of seconds to leave inactive connections open.
    Default is 120. 'Inactive' is defined as 'has received no data
    from the client and has sent no data to the client'.

--[no-]log-socket-errors
    Toggle whether premature client disconnect tracebacks ought to be
    logged. On by default.

--max-request-header-size=INT
    Maximum size of all request headers combined. Default is 262144
    (256KB).

--max-request-body-size=INT
    Maximum size of request body. Default is 1073741824 (1GB).

--[no-]expose-tracebacks
    Toggle whether to expose tracebacks of unhandled exceptions to the
    client. Off by default.

--asyncore-loop-timeout=INT
    The timeout value in seconds passed to asyncore.loop(). Default is 1.

--asyncore-use-poll
    The use_poll argument passed to ``asyncore.loop()``. Helps overcome
    open file descriptors limit. Default is False.

--channel-request-lookahead=INT
    Allows channels to stay readable and buffer more requests up to the
    given maximum even if a request is already being processed. This allows
    detecting if a client closed the connection while its request is being
    processed. Default is 0.

There was an exception (ImportError) importing your module.

It had these arguments:

  1. cannot import name 'url_quote' from 'werkzeug.urls' (D:\onnx-web\api\onnx_env\lib\site-packages\werkzeug\urls.py)
@sz1kormar
Copy link
Author

I'm new can someone explain this

@ssube
Copy link
Owner

ssube commented Nov 23, 2023

This is the second report I've gotten recently about this exception. It looks like something was updated in Flask but not Werkzeug or vice versa (discussed in https://stackoverflow.com/questions/77213053/why-did-flask-start-failing-with-importerror-cannot-import-name-url-quote-fr, among many other threads), so I need to go through and update the requirements.txt to match.

In the meantime, can you try running pip3 install --upgrade --force-reinstall werkzeug==2.2.2 and see if that helps at all? (replace pip3 with pip if that is what your system uses)

@ssube ssube modified the milestones: v0.10, v0.11 Dec 3, 2023
@FinecoFinit
Copy link

@ssube launched, but 404 on 127.0.0.1:5000

@ssube
Copy link
Owner

ssube commented Dec 6, 2023

There was a missing step in the setup guide which I have added to the documentation and will try to fix in the setup scripts before the next release: https://github.com/ssube/onnx-web/blob/main/docs/setup-guide.md#download-the-web-ui-bundle, 6e614aa.

Please try downloading those three files from https://github.com/ssube/onnx-web/tree/gh-pages/v0.11.0 and copying them into your local api/gui folder, keeping the JS bundle in the bundle subfolder.

@FinecoFinit
Copy link

@ssube Same 404

@ssube
Copy link
Owner

ssube commented Dec 10, 2023

I've updated the pinned version of Flask and pinned a compatible version of Werkzeug, so this should be fixed for new installs.

@FinecoFinit are you still getting a 404, or were you able to load the UI and see the list of models (#429)?

@ssube ssube self-assigned this Dec 10, 2023
@ssube ssube added status/fixed issues that have been fixed and released type/bug broken features scope/api labels Dec 10, 2023
@FinecoFinit
Copy link

@ssube no, I'm good, just instruction needs to be filled that client side starts separately, or I can use GitHub page

@ssube
Copy link
Owner

ssube commented Dec 15, 2023

The launch.bat and launch.ps1 scripts check for the web UI files before launching the server now: #378 (comment)

@ssube ssube closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/api status/fixed issues that have been fixed and released type/bug broken features
Projects
None yet
Development

No branches or pull requests

3 participants