Error when running the python file

hi guys, anyone can help me with these errors?

  A new version of Streamlit is available.

  See what's new at

  Enter the following command to upgrade:
  $ pip install streamlit --upgrade

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL:

2021-12-14 02:31:00.907 Uncaught exception GET /stream (::1)
HTTPServerRequest(protocol='http', host='localhost:8501', method='GET', uri='/stream', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 1704, in _execute
    result = await result
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 278, in get
    await self.ws_connection.accept_connection(self)
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 879, in accep
    await self._accept_connection(handler)
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 962, in _acce
    await self._receive_frame_loop()
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 1116, in _rec
    await self._receive_frame()
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 1205, in _rec
    handled_future = self._handle_message(opcode, data)
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 1217, in _han
    data = self._decompressor.decompress(data)
  File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\", line 798, in decom
    result = decompressor.decompress(
TypeError: 'float' object cannot be interpreted as an integer
C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\altair\utils\ UserWarning: I don't kn
ow how to infer vegalite type from 'empty'.  Defaulting to nominal.

my localhost become slower, cant rerun the localhost.

Hi @zalbich, welcome to the Streamlit community!

Can you post a snippet of code that demonstrates this behavior, either pasting here or linking to GitHub. The error message of TypeError: 'float' object cannot be interpreted as an integer is unfortunately not very descriptive by Python :frowning:


Hi @randyzwitch , thank you for replying.
But i think its not the code problems, i dont know why my localhost became slower from the first and i cant even rerun that. Any solution?

I had a similar error. The problem it turned out was that one function of my script changes the working directory (CWD) and it’s not rest back to the streamlit app dir. The error was fixed when I changed the cwd back after the said function has returned. Hope this helps you.