tensorflow: Cannot Install tensorflow-gpu on python=3.10.11

Click to expand!

Issue Type

Build/Install

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

2.12.0

Custom Code

No

OS Platform and Distribution

Windows 11

Mobile device

No response

Python version

3.10.11

Bazel version

No response

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

A bug happened!

Standalone code to reproduce the issue

pip install tensorflow-gpu

Relevant log output

Collecting tensorflow-gpu
  Downloading tensorflow-gpu-2.12.0.tar.gz (2.6 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      Traceback (most recent call last):
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\requirements.py", line 35, in __init__  
          parsed = parse_requirement(requirement_string)
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\_parser.py", line 64, in parse_requirement
          return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\_parser.py", line 82, in _parse_requirement
          url, specifier, marker = _parse_requirement_details(tokenizer)
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\_parser.py", line 126, in _parse_requirement_details
          marker = _parse_requirement_marker(
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\_parser.py", line 147, in _parse_requirement_marker
          tokenizer.raise_syntax_error(
        File "C:\Users\shiva\OneDrive\Desktop\LipNet\venv\lib\site-packages\setuptools\_vendor\packaging\_tokenizer.py", line 163, in raise_syntax_error
          raise ParserSyntaxError(
      setuptools.extern.packaging._tokenizer.ParserSyntaxError: Expected end or semicolon (after name and no valid version specifier)
          python_version>"3.7"
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 12
  • Comments: 23 (2 by maintainers)

Most upvoted comments

TensorFlow GPU is currently not available for Python 3.10.11 Downgrade your Python version to one of the supported versions Just uninstall current python and reinstall python version like 3.9 or below to use gpu.

ah ok.

it seems like there is no release of tensorflow for cuda 12 yet. i got the same error on python37 and above.

I have tried all of that. Torch recognizes the GPU but tf doesn’t

Please use tensorflow instead of tensorflow-gpu. See first bullet in TF 2.12 release notes: https://github.com/tensorflow/tensorflow/releases/tag/v2.12.0

answering the question, tensorflow-gpu will not work sometimes, you will have to know what you are doing, first check the compatibility of:

TensorFlow + Python + Nvidia “stuff” (drivers, CUDA toolkit, cuDNN)

If any of these are incompatible with each other for what you are doing then you need to check what you have and install the proper versions for each.

I am telling you this by assuming that your WSL2 is working properly and you understand how it works, if not then watch some videos that some folks explain how it works for you to understand.

if you can do what you want on Linux then use Ubuntu from the start.

FYI: https://www.tensorflow.org/install/source_windows

Note: GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin

Advice:

-I strongly recommend using Ubuntu, WSL2 is good but Ubuntu is simply the best for the resources it consumes when compared to Windows + WSL2. -Start asking yourself which version of Tensorflow you need then install all dependencies for GPU support.