flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.5k stars 449 forks source link

urllib.error.HTTPError: HTTP Error 404: Not Found #4193

Closed Wanna-Pizza closed 1 month ago

Wanna-Pizza commented 1 month ago

Duplicate Check

Describe the bug

PS H:\Flutter\project_flet\flet\sdk\python\playground> poetry run python main.py
Traceback (most recent call last):
  File "H:\Flutter\project_flet\flet\sdk\python\playground\main.py", line 7, in <module>
    flet.app(target=main)
  File "H:\Flutter\project_flet\flet\sdk\python\packages\flet\src\flet\app.py", line 51, in app
    return asyncio.run(
           ^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run     
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run     
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "H:\Flutter\project_flet\flet\sdk\python\packages\flet\src\flet\app.py", line 175, in app_async    
    fvp, pid_file = await open_flet_view_async(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 38, in open_flet_view_async
    args, flet_env, pid_file = __locate_and_unpack_flet_view(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 86, in __locate_and_unpack_flet_view
    zip_file = __download_flet_client("flet-windows.zip")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 176, in __download_flet_client
    urllib.request.urlretrieve(flet_url, temp_arch)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
                            ^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen  
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open     
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 563, in error    
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
PS H:\Flutter\project_flet\flet\sdk\python\playground>

This appear when I do poetry run python main.py

Code sample

Code ```python import flet from flet import Page, Text def main(page: Page): page.add(Text("Hello, world!")) flet.app(target=main) ```

To reproduce

Uhm. https://www.youtube.com/watch?v=tqf8dEQwBns&list=PLHYEoLmkidc1YrgREPrJvhr_JEv00EFP8

I just doing as this guy on video.

Expected behavior

To work it

Screenshots / Videos

Captures [Upload media here]

Operating System

Windows

Operating system details

Windows 11

Flet version

0.23.1

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs ```console PS H:\Flutter\project_flet\flet\sdk\python\playground> poetry run python main.py Traceback (most recent call last): File "H:\Flutter\project_flet\flet\sdk\python\playground\main.py", line 7, in flet.app(target=main) File "H:\Flutter\project_flet\flet\sdk\python\packages\flet\src\flet\app.py", line 51, in app return asyncio.run( ^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "H:\Flutter\project_flet\flet\sdk\python\packages\flet\src\flet\app.py", line 175, in app_async fvp, pid_file = await open_flet_view_async( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 38, in open_flet_view_async args, flet_env, pid_file = __locate_and_unpack_flet_view( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 86, in __locate_and_unpack_flet_view zip_file = __download_flet_client("flet-windows.zip") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\Flutter\project_flet\flet\sdk\python\packages\flet-desktop\src\flet_desktop\__init__.py", line 176, in __download_flet_client urllib.request.urlretrieve(flet_url, temp_arch) File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 563, in error return self._call_chain(*args) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found PS H:\Flutter\project_flet\flet\sdk\python\playground> ```

Additional details

No response

FeodorFitsner commented 1 month ago

Are you trying to run Flet from sources, not with pip install flet? Running from sources is used mostly when developing Flet itself.