App loading problem

Glad you figured it out! My suspicion here is that your original file was actually misnamed as streamlib_test.py instead of streamlib_test.ipynb…Streamlit only runs against Python scripts, not Jupyter Notebooks.

And I’ll add to @randyzwitch’s answer that Streamlit does not convert anything at all, it just reads your python script as is. This JSON file with that cell field is the format used for .ipynb notebooks.

1 Like

Yes, as a matter of fact. So sounds like this may have cause my original JSON to be created - somehow. I later saved as PY, but it may have somehow already been corrupted. That’s why creating from scratch as just a PY file got it working. Thanks

3 Likes

Buena Noche, Tengo el siguiente problema intentar correr una app, lo hago de la siguiente manera
C:\Users\user>streamlit run C:/semana 1/hola.py, y recibo el siguiente mensaje.

Error: Streamlit requires raw Python (.py) files, not .

Tienen idea de que puede ser

A través del Traductor de Google

¿Puede ejecutar streamlit run hola.py en lugar de la ruta completa del archivo? Me pregunto si los espacios en la ruta del archivo están causando un problema.

I also faced the same issue. Only thing that resolved my issue that I created text file and copied all my notebook code there and saved it as .py script then ran it using streamlit run file_name.py from the terminal. That’s it

I spent hours suffering and the solution came due to this point at the discussion: When you save a notebook .ipynb as .py, for some reason, it’s converted to a JSON format. That’s the reason for the problem!
Solution i found: Write again your code from scratch on .py file OR copy and past the code on it. Save and the magic happens!
Thank you!

1 Like