Ad D
Ad D

Reputation: 191

Streamlit requirements are not respected?

I have a streamlit app for which I specificated my libraries versions:

pandas==1.4.2
Pillow==9.1.1
plotly==5.8.2
requests==2.28.0
streamlit==1.18.1
wbgapi==1.0.8
streamlit-lottie==0.0.3
scikit-learn==1.1.1
matplotlib==3.6.3
seaborn==0.12.2
missingno==0.5.2
kneed==0.8.2

However my app in development seems to be using the latest version of the libraries. For example this page returns the following;

error message Traceback (most recent call last):

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/streamlit_app/pages/04_🔎 Process Analysis.py", line 332, in <module>

    df_gantt = df_gantt.append({'Step': i, 'Start': start, 'End': end, 'Duration': duration}, ignore_index=True)

  File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/generic.py", line 5989, in __getattr__

    return object.__getattribute__(self, name)

AttributeError: 'DataFrame' object has no attribute 'append'

And I have read online that the append was removed as of pandas 2.0. So I am confused as of why my app does not use the specified version?

Upvotes: 0

Views: 177

Answers (1)

Ayaz Khan
Ayaz Khan

Reputation: 138

Uninstall the current version of pandas:

pip uninstall pandas

Install a specific version of pandas that supports the append method:

pip install pandas==1.3.5

Upvotes: 1

Related Questions