0

I am currently working with anaconda on a project using python 3.11.4. I wish to install tensorflow using the command

conda install tensorflow

But when doing so I get the following message :

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment: Specifications: tensorflow -> python[version='3.10.|3.9.|3.8.|3.7.|3.6.|3.5.'] Your python: python=3.11

This message is very clear : I can not install tensorflow because I have a non-supported version of python. However, and this is my problem, tensorflow is supposed to work with python 3.11, as detailed here : https://www.tensorflow.org/install

And, to add complexity, I'm french so using a french version of tensorflow, which DOES NOT support python 3.11 (details : https://www.tensorflow.org/install?hl=fr)

So my question is : (i) why tensorflow does not support the same version of python in english and in french ? (ii) How to overcome this problem and installing the "english" version (or installing a compatible version) ?

Do you guys have any idea or explanation about this problem ?

I tried several searches and couldn't find anything comparable to my trouble.

EDIT : I'm using windows 11, conda version : 23.7.2

EDIT : Based on the comments and answers, the best solution for my problem is to install tensorflow using pip :

pip install tensorflow

Thanks ! Pierre

  • 1
    The french documentation is probably just out of date, there is no "french version" of tensorflow. Could you tell us the pip version you are using? If it is < 20, could you try updating it with `pip install --upgrade pip`? – Paolo Sini Aug 23 '23 at 08:32
  • 1
    @PaoloSini Op is using conda, not pip – FlyingTeller Aug 23 '23 at 08:35
  • What is your operating system? Windows, I assume? – FlyingTeller Aug 23 '23 at 08:35
  • 1
    Hi Paolo, thanks for answering. Yes the fact that there is a "french" version seemed suspicious to me... My pip version is 23.1.2. Excuse my naive question, but I'm new to anaconda. If I understand well, with anaconda the pip is useless as I'm using conda, so how the pip version could affect me ? – Pierre BOUCHET Aug 23 '23 at 08:37
  • @FlyingTeller yes windows 11 – Pierre BOUCHET Aug 23 '23 at 08:39
  • @Pierre BOUCHET As long as your conda environment is activated, you can use pip to install packages. Perhaps the latest version of tensorflow is not yet available as a conda package, so you could try installing it through pip instead – Paolo Sini Aug 23 '23 at 08:39
  • 1
    @PaoloSini Ok, so there is 2 ways with anaconda to install packages, with pip it seems working for now...so why using anaconda if pip is more updated ? (this question may be out of this field ^^) – Pierre BOUCHET Aug 23 '23 at 08:43
  • I believe conda can install binaries and packages in any language other than python, whereas pip only installs python packages. Don't quote me on that though, you can find more info here https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda#:~:text=This%20highlights%20a%20key%20difference,downloading%20and%20running%20an%20installer. :) – Paolo Sini Aug 23 '23 at 08:45
  • Yes indeed, there is a python agnostic thing with conda, and virtualenv... thx :) – Pierre BOUCHET Aug 23 '23 at 09:01
  • Python 3.11 is relatively new, it could take a while before Tensorflow is ported to it, but since it's a major version it's very likely to happen. If you cannot use one of supported versions, and if you have no other way to make it work, then you might simply have to wait. – jurez Aug 23 '23 at 09:10
  • Note that for the latest versions of TensorFlow there is [this caution](https://www.tensorflow.org/install/pip#windows-native) "_Caution: TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11, you will need to install TensorFlow in WSL2, or install tensorflow or tensorflow-cpu and, optionally, try the TensorFlow-DirectML-Plugin_". So, if you want to use GPU enabled TensorFlow (including under Python3.11), you should install WSL2 and install it as a Linux package via a Linux terminal. – Matt Pitkin Aug 23 '23 at 09:56

2 Answers2

0

There are multiple items in this question so I'll take them one by one:

I'm french so using a french version of tensorflow

There is no such thing, it's just the french translation of the docs

why using cvonda instead op pure PIP

In the context of the installation of tensorflow, you will may want to use CUDA based environment to access your GPU. It requires to know install and compile the correct version of CUDA. pip doesn't know how to do that as it's out of the scope of pure python installation, conda can. That is why most of the GPU supporting packages are pushing toward use of conda installation instead of pip.

why tensorflow does not support 3.11 ?

I check the versions available on the anaconda feedstock and didn't find any for windows and 3.11, maybe it's not released yet. https://anaconda.org/conda-forge/tensorflow/files?page=1

EDIT

Potential workaround (before tensorflow is effectively ported to 3.11 for windows) is to create a fresh conda environment based on 3.10:

conda create --name py310 python=3.10

In this environment, the installation should work without issues

Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
  • Maybe you could add some ideas to actually solve the issue `How to overcome this problem and installing the "english" version (or installing a compatible version)` – FlyingTeller Aug 23 '23 at 09:03
  • Thx Pierrick, I don't know much about CUDA things. But based on your answer I found this : https://docs.anaconda.com/free/anaconda/applications/tensorflow/ I leave it as it can be useful for later or for readers – Pierre BOUCHET Aug 23 '23 at 09:09
  • I thought about the solution you suggest in your edit, but I want to keep python 3.11, given that tensorflow is available on python 3.11 – Pierre BOUCHET Aug 23 '23 at 09:20
  • follow this issue on their github: https://github.com/tensorflow/tensorflow/issues/58032 looking at the tasks, windows is not yet supported – Pierrick Rambaud Aug 23 '23 at 11:19
  • It was in october 2022, may be not up to date ? – Pierre BOUCHET Aug 23 '23 at 12:06
  • that's something you could ask directly in their thread – Pierrick Rambaud Aug 23 '23 at 19:18
0

I'm not sure you solved it with pip install tensorflow but just to mention, (native) Windows only supports TensorFlow version up to 2.10 (see here). And TensorFlow 2.10 only supports up to Python 3.10.
So either you use TensorFlow with Windows WSL2, with Linux, or with python 3.10 or lower.

mhenning
  • 426
  • 4
  • 8