简体   繁体   中英

Poetry fails to install Scipy (Manjaro Linux, Python 3.10.5)

I'm trying to install Scipy using Poetry, but I get the following error message:

Using version ^1.9.0 for scipy

  The current project's Python requirement (>=3.10,<4.0) is not compatible with some of the required packages Python requirement:
    - scipy requires Python >=3.8,<3.12, so it will not be satisfied for Python >=3.12,<4.0
  
  Because scipy (1.9.0) requires Python >=3.8,<3.12
   and no versions of scipy match >1.9.0,<2.0.0, scipy is forbidden.
  So, because assistant depends on scipy (^1.9.0), version solving failed.

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/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)

I had a similar dependency error with poetry failing to install scipy. The fix for me was to change the line for Python in my pyproject.toml file from:

python = "^3.10"

to

python = ">=3.10,<3.12"

I'm not entirely sure why this fixed it, because it hasn't actually changed the version of python it installed, just how it thinks about the constraints.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM