Summary
The project is done by me before 2 months and I deployed it using streamlit share then it worked well now when i opened it is giving this error. And also it is working well i run it on local server.
Steps to reproduce
Code snippet:
add code here
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
It is working well when i run it on local server. When I checked logs it is checking for streamlit version and again updating some modules to higher versions which i didn’t mentioned in my requirements.txt.
Actual behavior:
KeyError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.__dict__)File "/app/olympics-data-analysis/app.py", line 84, in <module>
nations_over_time = helper.data_over_time(df,'region')File "/app/olympics-data-analysis/helper.py", line 46, in data_over_time
nations_over_time = df.drop_duplicates(['Year', col])['Year'].value_counts().reset_index().sort_values('index')File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/frame.py", line 6758, in sort_values
k = self._get_label_or_level_values(by, axis=axis)File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/generic.py", line 1778, in _get_label_or_level_values
And also it is working well i run it on local server. When I checked logs it is checking for streamlit version and again updating some modules to higher versions which i didn’t mentioned in my requirements.txt.
If you’re seeing an error message, share the full contents of the error message here.
Debug info
- Streamlit version: (get it with
$ streamlit version
) streamlit==1.18.1 - Python version: (get it with
$ python --version
) python 3.11 i tried using other versions also but it is giving same error - Using Conda? PipEnv? PyEnv? Pex? pycharm virtual environment venv
- OS version:
- Browser version:
Requirements file
this is there in my requirements.txt and which is created in pycharm by creating virtual environment venv by giving required commands to get requirements.txt file
altair==4.2.2
attrs==22.2.0
blinker==1.5
cachetools==5.3.0
certifi==2022.12.7
charset-normalizer==3.0.1
click==8.1.3
colorama==0.4.6
contourpy==1.0.7
cycler==0.11.0
decorator==5.1.1
entrypoints==0.4
fonttools==4.38.0
gitdb==4.0.10
GitPython==3.1.30
idna==3.4
importlib-metadata==6.0.0
Jinja2==3.1.2
joblib==1.2.0
jsonschema==4.17.3
kiwisolver==1.4.4
markdown-it-py==2.1.0
MarkupSafe==2.1.2
matplotlib==3.6.3
mdurl==0.1.2
numpy==1.24.2
packaging==23.0
pandas==1.5.3
Pillow==9.4.0
plotly==5.13.0
protobuf==3.20.3
pyarrow==11.0.0
pydeck==0.8.0
Pygments==2.14.0
Pympler==1.0.1
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
pytz==2022.7.1
pytz-deprecation-shim==0.1.0.post0
requests==2.28.2
rich==13.3.1
scikit-learn==1.2.1
scipy==1.10.0
seaborn==0.12.2
semver==2.13.0
six==1.16.0
smmap==5.0.0
streamlit==1.18.1
tenacity==8.2.0
threadpoolctl==3.1.0
toml==0.10.2
toolz==0.12.0
tornado==6.2
typing_extensions==4.4.0
tzdata==2022.7
tzlocal==4.2
urllib3==1.26.14
validators==0.20.0
watchdog==2.2.1
zipp==3.12.1
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
Links
- Link to your GitHub repo: https://github.com/RushiAadepu/Olympics-Data-Analysis
- Link to your deployed app: https://rushiaadepu-olympics-data-analysis-app-97k7u0.streamlit.app/
Additional information
If needed, add any other context about the problem here.
please give suggestions with which i can solve my problem