简体   繁体   中英

SolverProblemError on install Tensorfow with poetry

when i add tensoflow with poetry (poetry add tensorflow) i get this error:

Using version ^2.7.0 for tensorflow

Updating dependencies
Resolving dependencies... (0.8s)

  SolverProblemError

  The current project's Python requirement (>=3.6,<4.0) is not compatible with some of the required packages Python requirement:
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0
    - tensorflow-io-gcs-filesystem requires Python >=3.6, <3.10, so it will not be satisfied for Python >=3.10,<4.0

....

    For tensorflow-io-gcs-filesystem, a possible solution would be to set the `python` property to ">=3.6,<3.10"
    For tensorflow-io-gcs-filesystem, a possible solution would be to set the `python` property to ">=3.6,<3.10"
    For tensorflow-io-gcs-filesystem, a possible solution would be to set the `python` property to ">=3.6,<3.10"

The error message tells you, that your project aims to be compatible for python >=3.6,<4.0 (You probably have ^3.6 in your pyproject.toml), but pytorch says it's compatible only for >=3.6, <3.10. This is only a subset of the range of you project definition.

Poetry doesn't care about your current environment. It cares about a valid project definition at all.

The solution is already suggested within the error message. Set the version range for python in your pyproject.toml to >=3.6, <3.10 .

There is a conflict between the Python and the Tensorflow version in your project. As the message suggests, you can set the Python version between 3.6 and 3.10 . I can confirm python=3.8 works well with tensorflow=2.7.0 today in Ubuntu 20.04. This new Tensorflow version has been released last month, and it fixes the recent AlreadyExists error that happens with Tensorflow and Keras in the other versions, so I can recommend using this combination.

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