hi… I tried to run the uber.py app,which is there in the instruction on streamlit.io but every time I run the app through the command prompt it gives me this error :
NameError : name ‘null’ is not defined
File “c:\users\rashi\anaconda3\lib\site-packages\streamlit\ScriptRunner.py”, line 306, in _run_script exec(code, module.dict)
File “C:\Users\rashi\uber.py”, line 5, in “execution_count”: null,
Im using stream lit version:0.47.2 and I tried using the latest version as well 0.47.3
I’m having trouble reproducing your bug on my machine. So I dug around the codebase for both Streamlit and the Uber demo, and couldn’t find anything about execution_count. After a Google search it seems that execution_count is a variable that Jupyter keeps for each of its cells.
Which makes me wonder: can you explain in a little more detail what your setup looks like? How are you running the Uber app? Are you running Streamlit from inside Jupyter somehow?
thanks for the reply
well after writing the code I downloaded the file as a .py file on my desktop and ran “Streamlit run uber.py” in my terminal after which I get the following feedback "
You can now view your Streamlit app in your browser.
Local URL: http ://localhost:8501
but when it opens I get the execution_count errors, I tried running it without downloading directly from Jupiter but the same error occurred
Hi @adeell: Can you please share the exact error message you’re seeing, including the full stack trace?
Also, on the off-chance that this might tell us something, can you please make sure that Jupyter isn’t running when you streamlit run uber.py from the command line?
Hi! I have the same problem running the app in my browser, I’ve reinstalled streamlit but the error keeps occurring, could anyone help me please?
NameError: name ‘null’ is not defined
Traceback:
File "/Users/santiago/opt/anaconda3/lib/python3.7/site-packages/streamlit/ScriptRunner.py", line 322, in _run_script
exec(code, module.__dict__)File "/Users/santiago/iris-ml-app.py", line 61, in <module>
"execution_count": null,
File "/opt/oss/conda3/lib/python3.7/site-packages/streamlit/ScriptRunner.py", line 322, in _run_script
exec(code, module.__dict__)
File "/home/<username>/streamlib_test.py", line 5, in <module>
"execution_count": null,
I got the Streamlit demo to work in our virtual environment, but when I try to run a simple “Hello World” .py I get the exact same error. Here’s my py code:
import streamlit as st
st.write("Hello world")
But it looks like Streamlit creates a JSON version of my code, which is where I can see where “null” is, though I can’t explain it…
Yep - that’s what I originally had. Got a little desperate and removed quotes that last time, but yes. I ran it as st.write("Hello world") I’ll edit previous post to reflect that. Thanks
I guess the point is, I’ve seen several other people (as above) that are having the same experience. We’re “close” to getting it working - just not there yet.
Based on the “cells” part of the JSON, are you running this from Jupyter? If so, you should be running the demo from a Python script and streamlit run app.py from the command line.
Yes, running it from terminal. We set the server name, so it’s visible from all our VM environments. Which worked on the streamlit demo just fine - so we know that should not be the problem.
$ streamlit run streamlib_test.py --server.address 0.0.0.0
Good question. I assume streamlit converted it to JSON for processing. But it’s no coincidence that “Line 5” in the JSON format contains the null statement that several other people also receive this error about.
Wow… I couldn’t send my .PY file because it had gotten changed to that JSON format. So I recreated the 2 line file and now it ran fine! Puzzling. The only difference is the original file (that got converted to JSON) was at the root directory of our VM environment… This time I created it within my folder and no problems. The .PY file didn’t get converted to JSON. I can’t explain it, but it’s working now. Thanks for challenging me here a bit - cause it helped me get it working. Thanks!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.