Error installing requirements: python-unsplash

Hi. I am trying to deploy an upp, and it’s stuck on the requirements. My app uses Unsplash API via python-unsplash library. Locally everything works perfect. But when I try to deploy, it returns an error when installing the unsplash.

Error message I get:

Collecting python-unsplash

Downloading python-unsplash-1.0.1.tar.gz (11 kB)

Preparing metadata (setup.py): started

Preparing metadata (setup.py): finished with status ‘error’

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.

│ exit code: 1

╰─> [8 lines of output]

  Traceback (most recent call last):

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

    File "<pip-setuptools-caller>", line 34, in <module>

    File "/tmp/pip-install-txiomur2/python-unsplash_dafe8793fcfa4e7d97e752efac1da1fa/setup.py", line 14, in <module>

      requirements = [str(req.req) for req in install_requirements]

    File "/tmp/pip-install-txiomur2/python-unsplash_dafe8793fcfa4e7d97e752efac1da1fa/setup.py", line 14, in <listcomp>

      requirements = [str(req.req) for req in install_requirements]

  AttributeError: 'ParsedRequirement' object has no attribute 'req'

  [end of output]

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

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

WARNING: You are using pip version 22.0.3; however, version 22.3.1 is available.

You should consider upgrading via the ‘/home/appuser/venv/bin/python -m pip install --upgrade pip’ command.

Is there any way to solve it without giving up on Unsplash?

Upd:
my requirements file is:
streamlit
openai
python-unsplash
streamlit_analytics
requests
pypi-json
pillow
firebase_admin

I have tried to place unsplash above the openai, but then openai doesn’t load.

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