Error Installing Requirements when deploying the app

I have a code that i tried running on local host , it works completely fine but after i deployed the streamlit app im getting error installing requirements. I know which module is giving error, when i removes pattern module from requirements it works fine but when i add pattern module in requriement.txt it again starts giving error installing requirements

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
  ╰─> [27 lines of output]
      /bin/sh: 1: pkg-config: not found
      /bin/sh: 1: pkg-config: not found
      Trying pkg-config --exists mysqlclient
      Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
      Trying pkg-config --exists mariadb
      Command 'pkg-config --exists mariadb' returned non-zero exit status 127.
      Traceback (most recent call last):
        File "/home/adminuser/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/adminuser/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/adminuser/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-zd2nd3_r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-zd2nd3_r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-zd2nd3_r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 154, in <module>
        File "<string>", line 48, in get_config_posix
        File "<string>", line 27, in find_package_name
      Exception: Can not find valid pkg-config name.
      Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
      [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.

Hey @Aniket_kajania,

Can you share the contents of your requirements.txt file?

Im getting the same error, I haven’t changed my requirements.txt for the past few days . I was able to deploy my app with no issue. Below is the requirements.text

altair==5.0.1

attrs==23.1.0

blinker==1.6.2

cachetools==5.3.1

certifi==2023.7.22

charset-normalizer==3.2.0

click==8.1.6

decorator==5.1.1

gitdb==4.0.10

GitPython==3.1.32

idna==3.4

importlib-metadata==6.8.0

Jinja2==3.1.2

jsonschema==4.18.4

jsonschema-specifications==2023.7.1

markdown-it-py==3.0.0

MarkupSafe==2.1.3

mdurl==0.1.2

numpy==1.25.1

packaging==23.1

pandas==2.0.3

Pillow==9.5.0

protobuf==4.23.4

pyarrow==12.0.1

pydeck==0.8.0

Pygments==2.15.1

Pympler==1.0.1

python-dateutil==2.8.2

pytz==2023.3

pytz-deprecation-shim==0.1.0.post0

referencing==0.30.0

requests==2.31.0

rich==13.4.2

rpds-py==0.9.2

six==1.16.0

smmap==5.0.0

streamlit==1.25.0

streamlit-mermaid==0.2.0

tenacity==8.2.2

toml==0.10.2

toolz==0.12.0

tornado==6.3.2

typing_extensions==4.7.1

tzdata==2023.3

tzlocal==4.3.1

urllib3==2.0.4

validators==0.20.0

watchdog==3.0.0

zipp==3.16.2

Hey @leowu4ever ,

I don’t see the patterns module mentioned in streamlit requirements.txt.

Did you make sure you put the same version as the one working on your localhost?

Sometimes, different versions of the libraries lack different features which gives them issues when deploying.

Please also link your github code, I’d love to take a deeper look and recreate the issue on my side.

seaborn
urlextract
wordcloud
googletrans==3.1.0a0
transformers
scipy
pattern

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