lllyasviel / lllyasviel/FramePack
python demo_gradio.py: normalize port ValueError: invalid literal for int() with base 10: ':' when import Gradio as gr
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
I have updated my gradio version to 5.25.2.
But when I type command: python demo_gradio.py, there is error as below, how to solve it:
Traceback (most recent call last):
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_urlparse.py", line 409, in normalize_port
port_as_int = int(port)
^^^^^^^^^
ValueError: invalid literal for int() with base 10: ':'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "${username}/FramePack/demo_gradio.py", line 7, in
import gradio as gr
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/__init__.py", line 3, in
import gradio._simple_templates
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/_simple_templates/__init__.py", line 1, in
from .simpledropdown import SimpleDropdown
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/_simple_templates/simpledropdown.py", line 7, in
from gradio.components.base import Component, FormComponent
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/components/__init__.py", line 1, in
from gradio.components.annotated_image import AnnotatedImage
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/components/annotated_image.py", line 14, in
from gradio import processing_utils, utils
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/gradio/processing_utils.py", line 120, in
sync_client = httpx.Client(transport=sync_transport)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_client.py", line 697, in __init__
self._mounts: dict[URLPattern, BaseTransport | None] = {
^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_client.py", line 698, in
URLPattern(key): None
^^^^^^^^^^^^^^^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_utils.py", line 172, in __init__
url = URL(pattern)
^^^^^^^^^^^^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_urls.py", line 117, in __init__
self._uri_reference = urlparse(url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_urlparse.py", line 321, in urlparse
parsed_port: int | None = normalize_port(port, scheme)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "${username}/FramePack/framepack_env/lib/python3.11/site-packages/httpx/_urlparse.py", line 411, in normalize_port
raise InvalidURL(f"Invalid port: {port!r}")
httpx.InvalidURL: Invalid port: ':'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running demo_gradio.py in the reported Python 3.11 environment and inspect the import path through gradio.processing_utils into httpx. Compare the installed Gradio and HTTPX versions and their proxy or URL configuration; done means the demo imports and starts without the Invalid port error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100