Module import error

I have tried everything and have hit a wall. I have a requirements.txt file and it runs fine when I run it on my localhost, but it will not upload to streamlit.io at all. here is my req.txt file. It rejects Matplotlib and Plotly

altair==5.1.1

appdirs==1.4.4

attrs==23.1.0

beautifulsoup4==4.12.2

blinker==1.6.2

cachetools==5.3.1

certifi==2023.7.22

charset-normalizer==3.2.0

click==8.1.7

colorama==0.4.6

contourpy==1.1.0

cycler==0.11.0

fonttools==4.42.1

frozendict==2.3.8

gitdb==4.0.10

GitPython==3.1.35

html5lib==1.1

idna==3.4

importlib-metadata==6.8.0

Jinja2==3.1.2

jsonschema==4.19.0

jsonschema-specifications==2023.7.1

kiwisolver==1.4.5

lxml==4.9.3

markdown-it-py==3.0.0

MarkupSafe==2.1.3

matplotlib==3.7.2

mdurl==0.1.2

multitasking==0.0.11

numpy==1.25.2

packaging==23.1

pandas==2.1.0

Pillow==9.5.0

plotly==5.16.1

protobuf==4.24.3

pyarrow==13.0.0

pydeck==0.8.0

Pygments==2.16.1

Pympler==1.0.1

pyparsing==3.0.9

python-dateutil==2.8.2

pytz==2023.3.post1

pytz-deprecation-shim==0.1.0.post0

referencing==0.30.2

requests==2.31.0

rich==13.5.2

rpds-py==0.10.2

seaborn==0.12.2

six==1.16.0

smmap==5.0.0

soupsieve==2.5

streamlit==1.26.0

tenacity==8.2.3

toml==0.10.2

toolz==0.12.0

tornado==6.3.3

typing_extensions==4.7.1

tzdata==2023.3

tzlocal==4.3.1

urllib3==2.0.4

validators==0.22.0

watchdog==3.0.0

webencodings==0.5.1

zipp==3.16.2

Please share a link to your public github repo.

What does that mean exactly? Please provide precise information. Are there already error messages during the deployment or only at runtime? What are the error messages?

FunWithData/tuxedo.py at main · NEPatriots-Coder/FunWithData (github.com)

Here are the errors I’m getting when I am trying to launch the app:

File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)File "/mount/src/funwithdata/tuxedo.py", line 6, in <module>
    penguins_df = pd.read_csv(r"C:\Users\lamarwells\Penguins\penguins.csv")File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 948, in read_csv
    return _read(filepath_or_buffer, kwds)File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 611, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1448, in __init__
    self._engine = self._make_engine(f, self.engine)File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1705, in _make_engine
    self.handles = get_handle(File "/home/adminuser/venv/lib/python3.9/site-packages/pandas/io/common.py", line 863, in get_handle
    handle = open(
penguins_df = pd.read_csv(r"C:\Users\lamarwells\Penguins\penguins.csv")

You don’t have access to the clients filesystem whenever the streamlit app is hosted.
Put the files in your folder and under git control and just do:

penguins_df = pd.read_csv("penguins.csv")

It seems I skipped class on the “how to import a csv correctly day” so sorry to bother you with something so trivial I figured it out. Thank you for your help and streamlit is the shizzle!!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.