Error installing requirements - matplotlib

Hello! I’m trying to deploy an app that will allow students (I’m a TA) to quickly display their data projects. Everything was working on my machine, but when I deployed to the community cloud I got an error saying matplotlib wasn’t installed/found. I tried creating a requirements.txt file with everything and I am now getting a different error reading " Error installing requirements.". So far creating the requirements file is all I’ve done.

Here is the app link (the project is currently broken): https://comp-sci-graphs.streamlit.app/

Here is the link to the GitHub repo: https://github.com/beck1888/Streamlit-Graph-Projects/tree/main

And here is a copy of the requirments.txt file from the repo:

matplotlib==3.4.1
streamlit==1.34.0
pandas==2.2.1

Here’s the error messages from the β€œmanage app” tab I’ve been looking into:

Using standard pip install.

Collecting matplotlib==3.4.1 (from -r /mount/src/streamlit-graph-projects/requirements.txt (line 1))

  Downloading matplotlib-3.4.1.tar.gz (37.3 MB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.3/37.3 MB 169.9 MB/s eta 0:00:00[2024-05-08 03:28:07.456671] 

  Installing build dependencies: started

  Installing build dependencies: finished with status 'done'

  Getting requirements to build wheel: started

  Getting requirements to build wheel: finished with status 'error'

  error: subprocess-exited-with-error

  

  Γ— Getting requirements to build wheel did not run successfully.

  β”‚ exit code: 1

  ╰─> [29 lines of output]

      Traceback (most recent call last):

        File "/home/adminuser/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>

          main()

        File "/home/adminuser/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main

          json_out['return_val'] = hook(**hook_input['kwargs'])

                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        File "/home/adminuser/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel

          return hook(config_settings)

                 ^^^^^^^^^^^^^^^^^^^^^

        File "/tmp/pip-build-env-uvevur6m/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel

          return self._get_build_requires(config_settings, requirements=['wheel'])

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        File "/tmp/pip-build-env-uvevur6m/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires

          self.run_setup()

        File "/tmp/pip-build-env-uvevur6m/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup

          super().run_setup(setup_script=setup_script)

        File "/tmp/pip-build-env-uvevur6m/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup

          exec(code, locals())

        File "<string>", line 54, in <module>

        File "/tmp/pip-install-0is7p124/matplotlib_b9033c26e519424290324d2173a4e7cd/versioneer.py", line 1410, in get_version

          return get_versions()["version"]

                 ^^^^^^^^^^^^^^

        File "/tmp/pip-install-0is7p124/matplotlib_b9033c26e519424290324d2173a4e7cd/versioneer.py", line 1344, in get_versions

          cfg = get_config_from_root(root)

                ^^^^^^^^^^^^^^^^^^^^^^^^^^

        File "/tmp/pip-install-0is7p124/matplotlib_b9033c26e519424290324d2173a4e7cd/versioneer.py", line 401, in get_config_from_root

          parser = configparser.SafeConfigParser()

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

      [end of output]

  

  note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error


Γ— Getting requirements to build wheel did not run successfully.

β”‚ exit code: 1

╰─> See above for output.


note: This error originates from a subprocess, and is likely not a problem with pip.

Checking if Streamlit is installed


────────────────────────────────────────────────────────────────────────────────────────


[03:28:13] ❗️ installer returned a non-zero exit code

[03:28:13] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

[03:29:48] ❗️ Streamlit server consistently failed status checks

[03:29:48] ❗️ Please fix the errors, push an update to the git repo, or reboot the app.

I still am somewhat new to streamlit (and honestly to python too), so I am wondering if this issue comes from a small mistake I made. I’m fully open to any help. I’m also happy to provide more details if that would be useful. Thank you so much :slight_smile:

Use a more recent matplotlib (or an older python).

Solved! Downgraded my Python version which fixed all the issues. Thank you!

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