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

Can't install tensorflow on linux #8764

Closed
4 tasks done
sh-shahrokhi opened this issue Dec 8, 2023 · 12 comments
Closed
4 tasks done

Can't install tensorflow on linux #8764

sh-shahrokhi opened this issue Dec 8, 2023 · 12 comments
Labels
kind/bug Something isn't working as expected

Comments

@sh-shahrokhi
Copy link

  • Poetry version: 1.71
  • Python version: 3.11.6
  • OS version and name: OpenSUSE-Tumbleweed, latest
  • pyproject.toml:

[tool.poetry]
name = "new"
version = "0.1.0"
description = ""
authors = ["Your Name [email protected]"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11,<3.12"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Can't install tensorflow on linux.

❯ poetry add tensorflow
Using version ^2.15.0.post1 for tensorflow

Updating dependencies
Resolving dependencies... (1.3s)

Because no versions of tensorflow match >2.15.0.post1,<3.0.0
and tensorflow (2.15.0.post1) depends on tensorflow-intel (2.15.0.post1), tensorflow (>=2.15.0.post1,<3.0.0) requires tensorflow-intel (2.15.0.post1).
So, because no versions of tensorflow-intel match 2.15.0.post1
and new depends on tensorflow (^2.15.0.post1), version solving failed.

@sh-shahrokhi sh-shahrokhi added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 8, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Dec 8, 2023

the output makes clear why this can't work: because there is no tensorflow-intel 2.15.0.post1

you'll need to report that to tensorflow. please close.

@sh-shahrokhi
Copy link
Author

sh-shahrokhi commented Dec 8, 2023

Hello, it works with pip, just not with poetry.

Also in the setup.py of tensorflow, there is this line:
"tensorflow-intel (==2.15.0.post1) ; platform_system == \"Windows\"",
So, I think Poetry shouldn't be looking for tensorflow-intel when I'm using linux.

"requires_dist": [
            "absl-py (>=1.0.0)",
            "astunparse (>=1.6.0)",
            "flatbuffers (>=23.5.26)",
            "gast (!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1)",
            "google-pasta (>=0.1.1)",
            "h5py (>=2.9.0)",
            "libclang (>=13.0.0)",
            "ml-dtypes (~=0.2.0)",
            "numpy (<2.0.0,>=1.23.5)",
            "opt-einsum (>=2.3.2)",
            "packaging",
            "protobuf (!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3)",
            "setuptools",
            "six (>=1.12.0)",
            "termcolor (>=1.1.0)",
            "typing-extensions (>=3.6.6)",
            "wrapt (<1.15,>=1.11.0)",
            "tensorflow-io-gcs-filesystem (>=0.23.1)",
            "grpcio (<2.0,>=1.24.3)",
            "tensorboard (<2.16,>=2.15)",
            "tensorflow-estimator (<2.16,>=2.15.0)",
            "keras (<2.16,>=2.15.0)",
            "tensorflow-cpu-aws (==2.15.0.post1) ; platform_system == \"Linux\" and (platform_machine == \"arm64\" or platform_machine == \"aarch64\")",
            "tensorflow-intel (==2.15.0.post1) ; platform_system == \"Windows\"",
            "nvidia-cublas-cu12 (==12.2.5.6) ; extra == 'and-cuda'",
            "nvidia-cuda-cupti-cu12 (==12.2.142) ; extra == 'and-cuda'",
            "nvidia-cuda-nvcc-cu12 (==12.2.140) ; extra == 'and-cuda'",
            "nvidia-cuda-nvrtc-cu12 (==12.2.140) ; extra == 'and-cuda'",
            "nvidia-cuda-runtime-cu12 (==12.2.140) ; extra == 'and-cuda'",
            "nvidia-cudnn-cu12 (==8.9.4.25) ; extra == 'and-cuda'",
            "nvidia-cufft-cu12 (==11.0.8.103) ; extra == 'and-cuda'",
            "nvidia-curand-cu12 (==10.3.3.141) ; extra == 'and-cuda'",
            "nvidia-cusolver-cu12 (==11.5.2.141) ; extra == 'and-cuda'",
            "nvidia-cusparse-cu12 (==12.1.2.141) ; extra == 'and-cuda'",
            "nvidia-nccl-cu12 (==2.16.5) ; extra == 'and-cuda'",
            "nvidia-nvjitlink-cu12 (==12.2.140) ; extra == 'and-cuda'"

@dimbleby
Copy link
Contributor

dimbleby commented Dec 8, 2023

(i) poetry builds cross-platform solutions. So it doesn't matter that you're currently on linux, poetry still needs to solve for Windows too
(ii) tensorflow-cpu-aws version 2.15.0.post1 is also missing anyway

please take it to tensorflow, please close

@sh-shahrokhi sh-shahrokhi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2023
@liaozd
Copy link

liaozd commented Dec 12, 2023

but why pip install tensorflow works, poetry not? I use ubuntu 22.04 and poetry 1.7.1

@Jasonsey
Copy link

Jasonsey commented Dec 19, 2023

@liaozd I have the same problem in windows, after I run this command:

poetry add tensorflow tensorflow-text

Here is the log:

(py310) PS > poetry add tensorflow tensorflow-text
Using version ^2.15.0.post1 for tensorflow
Using version ^2.15.0 for tensorflow-text

Updating dependencies
Resolving dependencies... (0.7s)

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

    Because no versions of tensorflow-text match >2.15.0,<3.0.0
 and tensorflow-text (2.15.0) depends on tensorflow (>=2.15.0,<2.16), tensorflow-text (>=2.15.0,<3.0.0) requires tensorflow (>=2.15.0,<2.16).
(1) So, because no versions of tensorflow match >2.15.0.post1,<2.16
 and tensorflow (2.15.0.post1) depends on tensorflow-io-gcs-filesystem (>=0.23.1), tensorflow-text (>=2.15.0,<3.0.0) requires tensorflow-io-gcs-filesystem (>=0.23.1) or tensorflow (>=2.15.0,<2.15.0.post1).

    Because no versions of tensorflow-io-gcs-filesystem match >0.23.1,<0.24.0 || >0.24.0,<0.25.0 || >0.25.0,<0.26.0 || >0.26.0,<0.27.0 || >0.27.0,<0.28.0 || >0.28.0,<0.29.0 || >0.29.0,<0.30.0 || >0.30.0,<0.31.0 || >0.31.0,<0.32.0 || >0.32.0,<0.33.0 || >0.33.0,<0.34.0 || >0.34.0,<0.35.0 || >0.35.0
 and tensorflow-io-gcs-filesystem (0.23.1) requires Python >=3.7, <3.11, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.24.0) requires Python >=3.7, <3.11
 and tensorflow-io-gcs-filesystem (0.34.0) requires Python >=3.7, <3.12, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.33.0) requires Python >=3.7, <3.12
 and tensorflow-io-gcs-filesystem (0.32.0) requires Python >=3.7, <3.12, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.31.0) requires Python >=3.7, <3.12
 and tensorflow-io-gcs-filesystem (0.30.0) requires Python >=3.7, <3.12, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.29.0) requires Python >=3.7, <3.12
 and tensorflow-io-gcs-filesystem (0.28.0) requires Python >=3.7, <3.11, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.27.0) requires Python >=3.7, <3.11
 and tensorflow-io-gcs-filesystem (0.26.0) requires Python >=3.7, <3.11, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-io-gcs-filesystem (0.25.0) requires Python >=3.7, <3.11
 and tensorflow-io-gcs-filesystem (0.35.0) requires Python >=3.7, <3.12, tensorflow-io-gcs-filesystem is forbidden.
    And because tensorflow-text (>=2.15.0,<3.0.0) requires tensorflow-io-gcs-filesystem (>=0.23.1) or tensorflow (>=2.15.0,<2.15.0.post1) (1), tensorflow-text (>=2.15.0,<3.0.0) requires tensorflow (>=2.15.0,<2.15.0.post1)
    So, because build-embedding-model depends on both tensorflow (^2.15.0.post1) and tensorflow-text (^2.15.0), version solving failed.

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

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

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

@Jasonsey
Copy link

and here is the pyproject.toml

[tool.poetry]
name = "xxx"
version = "0.1.0"
description = ""
authors = [""]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

@baranyildirim
Copy link

baranyildirim commented Dec 24, 2023

I'm not sure why the maintainer is so unhelpful. If this issue reproduces with poetry and not pip, it is a poetry issue. I found this workaround for anyone who stumbles on this thread.

@clintonroy
Copy link
Contributor

@baranyildirim poetry relies on the package metadata to resolve packages, tensorflow does not consistently contain the required metadata. Pip and Poetry are different tools, they are not equivalent.

@baranyildirim
Copy link

@baranyildirim poetry relies on the package metadata to resolve packages, tensorflow does not consistently contain the required metadata. Pip and Poetry are different tools, they are not equivalent.

The reasoning doesn't matter to the people trying to use the tool. If you want to respond to an issue like this, just point to the issue that is already open about TensorFlow metadata. This will help people who find this thread and will actually be quicker than arguing with people about why this issue is occurring. Stonewalling doesn't help anyone and reflects poorly on the tool.

@sh-shahrokhi
Copy link
Author

sh-shahrokhi commented Dec 24, 2023 via email

@SergeyHein
Copy link

As advised in #4605 (comment)

I've raised this to tensorflow

tensorflow/tensorflow#64847

Copy link

github-actions bot commented May 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

8 participants