Issue with dependencies for poetry lock file and streamlit cloud

I’m having issues deploying my app to streamlit cloud

below I the issue in the logs

 The current project's Python requirement (3.7.12) is not compatible with some of the required packages Python requirement:

    - numpy requires Python >=3.8, so it will not be satisfied for Python 3.7.12

  

  Because no versions of pandas match >=1.3.3,<1.3.5 || >1.3.5,<2.0.0

   and pandas (1.3.5) depends on numpy (>=1.17.3), pandas (>=1.3.3,<2.0.0) requires numpy (>=1.17.3).

  Because numpy (1.22.0) requires Python >=3.8

   and no versions of numpy match >=1.17.3,<1.22.0 || >1.22.0, numpy is forbidden.

  Thus, pandas is forbidden.

  So, because yt-comments depends on pandas (^1.3.3), version solving failed.


  at ~/.poetry/lib/poetry/puzzle/solver.py:241 in _solve

      237│             packages = result.packages

      238│         except OverrideNeeded as e:

      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)

      240│         except SolveFailure as e:

    → 241│             raise SolverProblemError(e)

      242│ 

      243│         results = dict(

      244│             depth_first_search(

      245│                 PackageNode(self._package, packages), aggregate_package_nodes


  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    

    For numpy, a possible solution would be to set the `python` property to "<empty>"


    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,

    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

I’ve been trying to solve this for the past hour so any help is greatly appreciated.

Here is the link to my github repo GitHub - benthecoder/yt-comments-mongodb-search

If your packages really require Python 3.8, you can set the package version through the deployment menu:

Best,
Randy

Thanks for the reply @randyzwitch, didn’t know I could set Python versions as it wasn’t clear to me it was in the advanced settings.
I have a new problem now where it doesn’t recognize my style.css file, even though it’s in my github repo, Does reading files work differently in streamlit cloud?

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/script_runner.py", line 354, in _run_script

    exec(code, module.__dict__)

  File "/app/yt-comments-mongodb-search/yt_comments/app.py", line 148, in <module>

    main()

  File "/app/yt-comments-mongodb-search/yt_comments/app.py", line 78, in main

    local_css("style.css")

  File "/app/yt-comments-mongodb-search/yt_comments/app.py", line 29, in local_css

    with open(file_name) as f:

FileNotFoundError: [Errno 2] No such file or directory: 'style.css'

Reading files in Streamlit Cloud is no different than any other Python; the issue you are referencing is quite common due to a bad relative reference. The usual recommendation is to use pathlib to use Python to locate the file, as demonstrated in this post:

Best,
Randy

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