Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following the tutorial 'Build a FastAPI Server' fails at the second step... #802

Open
coredevel opened this issue Feb 9, 2022 · 1 comment
Labels
bug Describes a bug in the system.

Comments

@coredevel
Copy link

Able to setup a new poetry project and install gino[starlette] but then following the next step to install fastapi, uvicorn & gunicorn results in an error:


$ poetry add gino[starlette]
Using version ^1.0.1 for gino

Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

Package operations: 8 installs, 0 updates, 0 removals

  • Installing idna (3.3)
  • Installing sniffio (1.2.0)
  • Installing anyio (3.5.0)
  • Installing gino (1.0.1)
  • Installing starlette (0.16.0)
  • Installing asyncpg (0.25.0)
  • Installing gino-starlette (0.1.3)
  • Installing sqlalchemy (1.3.24)

$ poetry add fastapi uvicorn gunicorn
Using version ^0.73.0 for fastapi
Using version ^0.17.4 for uvicorn
Using version ^20.1.0 for gunicorn

Updating dependencies
Resolving dependencies... (0.1s)

  SolverProblemError

  Because no versions of gino-starlette match >0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<0.2.0
   and gino-starlette (0.1.1) depends on starlette (>=0.13.0,<0.14.0), gino-starlette (>=0.1.1,<0.1.2 || >0.1.2,<0.1.3 || >0.1.3,<0.2.0) requires starlette (>=0.13.0,<0.14.0).
  And because gino-starlette (0.1.2) depends on starlette (>=0.13.0,<0.15.0)
   and gino-starlette (0.1.3) depends on starlette (>=0.16,<0.17), gino-starlette (>=0.1.1,<0.2.0) requires starlette (>=0.13.0,<0.15.0 || >=0.16,<0.17).
  Because no versions of fastapi match >0.73.0,<0.74.0
   and fastapi (0.73.0) depends on starlette (0.17.1), fastapi (>=0.73.0,<0.74.0) requires starlette (0.17.1).
  Thus, fastapi (>=0.73.0,<0.74.0) is incompatible with gino-starlette (>=0.1.1,<0.2.0).
  And because gino (1.0.1) depends on gino-starlette (>=0.1.1,<0.2.0)
   and no versions of gino match >1.0.1,<2.0.0, fastapi (>=0.73.0,<0.74.0) is incompatible with gino (>=1.0.1,<2.0.0).
  So, because gino-fastapi-demo depends on both gino (^1.0.1) and fastapi (^0.73.0), 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

@coredevel coredevel added the bug Describes a bug in the system. label Feb 9, 2022
@dzerrenner
Copy link

I was able to confirm that. As a wirkaround, pinning fastapi to an older version, i.e. poetry add "fastapi<0.71" proceeds with the install. The resulting part of pyproject.toml (ignore psycopg2-binary, i was too lazy to install build tools just for testing...)

[tool.poetry.dependencies]
python = "^3.10"
gino = {extras = ["starlette"], version = "^1.0.1"}
fastapi = "<0.71"
uvicorn = "^0.17.5"
alembic = "^1.7.6"
psycopg2-binary = "^2.9.3"

This takes me at least to the tutorial step where the server starts with no operations. Implications of using an older fastapi version apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Describes a bug in the system.
Projects
None yet
Development

No branches or pull requests

2 participants