Problems installing Tensorflow and Keras?

I’m trying to install Tensorflow and Keras into an environment using the Navigator. It seems to be “stuck” on resolving packages. Is it normal to take so long? Is there an alternative?

Hello,

Tensorflow is really large and contains a lot of packages. It may take awhile to install everything.

Did you try creating a NEW conda environment and installing both Tensorflow and Keras into that new conda environment? You should avoid trying to install these packages into the base conda environment as that can lead to package conflicts.

The Tensorflow version in the Anaconda Navigator does not match the Python version in the Navigator and therefore cannot be installed. How can I get the current Tensorflow version into the Navigator and then install it?

I am not 100% sure that I understand the problem here…
Can you please attach a screenshot showing the issue - that should help.

Hi, thanks for your answer. The error message when installing the Tensorflow package is:
LibMambaUnsatisfiableError: Encountered problems while solving:

  • nothing provides bleach 1.5.0 needed by tensorboard-1.7.0-py35he025d50_1

Could not solve for environment specs
The following packages are incompatible
├─ pin-1 is installable and it requires
│ └─ python 3.11.* , which can be installed;
└─ tensorflow is not installable because there are no viable options
├─ tensorflow [1.10.0|1.9.0] would require
│ └─ python 3.5.* , which conflicts with any installable versions previously reported;
├─ tensorflow [1.10.0|1.11.0|…|2.1.0] would require
│ └─ python 3.6.* , which conflicts with any installable versions previously reported;
├─ tensorflow [1.13.1|1.14.0|…|2.9.1] would require
│ └─ python 3.7.* , which conflicts with any installable versions previously reported;
├─ tensorflow [1.7.0|1.7.1|1.8.0] would require
│ └─ tensorboard [>=1.7.0,<1.8.0 |>=1.8.0,<1.9.0 ], which requires
│ └─ bleach 1.5.0 , which does not exist (perhaps a missing channel);
├─ tensorflow [2.10.0|2.8.2|2.9.1] would require
│ └─ python 3.10.* , which conflicts with any installable versions previously reported;
├─ tensorflow [2.10.0|2.3.0|…|2.9.1] would require
│ └─ python 3.8.* , which conflicts with any installable versions previously reported;
└─ tensorflow [2.10.0|2.5.0|2.6.0|2.8.2|2.9.1] would require
└─ python 3.9.* , which conflicts with any installable versions previously reported.

Pins seem to be involved in the conflict. Currently pinned specs:

  • python 3.11.* (labeled as ‘pin-1’)
    The Python version installed with the Navigator is 3.11.5, the Tensorflow version offered by the Navigator is 2.10.0. There seems to be a problem with compatibility. How can I load the appropriate Tensorflow version?

I have not seen that error before when installing Tensorflow and Keras.
I would try installing the packages from a Anaconda command prompt as follows - that should work:

conda create -n tflowenv tensorflow keras
conda activate tflowenv

If it fails paste the output below or let me know if it fails the same way.

1 Like

The following error message appears after installation: InvalidArchiveError(“Error with archive C:\Users\Wienert\AppData\Local\anaconda3\pkgs\tensorflow-base-2.10.0-mkl_py310h6a7f48e_0.conda. You probably need to delete and re-download or re-create this file. Message was:\n\nfailed with error: [Errno 2] No such file or directory: ‘C:\\Users\\Wienert\\AppData\\Local\\anaconda3\\pkgs\\tensorflow-base-2.10.0-mkl_py310h6a7f48e_0\\Lib\\site-packages\\tensorflow\\include\\tensorflow\\compiler\\mlir\\hlo\\_virtual_includes\\compose_set_interface_inc_gen\\mlir-hlo\\Dialect\\gml_st\\transforms\\compose_set_interface.h.inc’”)
Even after deleting the file and re-downloading, the same error message appears.

I have been getting exactly the same error over the past week while trying to install tensorflow.

The folder ‘tensorflow-base-2.10.0-mkl_py310h6a7f48e_0’ is not getting created in the ‘pkgs’ folder.

Any suggestions would be very welcome.

Hi! I am getting the same error, can anyone please help?

I’ve just tested to install same packages to the clean laptop without any corporate policies and everything was fine!

Yes, I think it is a corporate policy that is my problem. So far I’ve been getting a glazed expression when I mention Miniconda to IT staff, but I am still pursuing!

I would check and verify whether you have write access to the ‘AppData’ folder. In my experience a lot of corporate users do not. Anaconda needs to have write access under the ‘anaconda3’ installation folder to write package information.

This worked perfectly and has saved me from having to wait for forever for the virtual device of my school to do the training for my AI class. Thank you!

This error message indicates that there are conflicting package requirements in your environment, specifically related to TensorFlow and its dependencies. To resolve this issue, you can try the following steps:

  1. Update Conda: Make sure your Conda package manager is up to date by running the following command:

    conda update conda

  2. Update Anaconda: Update your Anaconda distribution to the latest version to ensure compatibility with the required packages. You can do this by running:

    conda update anaconda

  3. Create a New Environment: Create a new Conda environment with Python 3.7 (or any compatible version) and install TensorFlow and Keras within this environment. You can create a new environment with Python 3.7 using the following command:

    conda create -n myenv python=3.7

  4. Install TensorFlow and Keras: Activate the new environment and install TensorFlow and Keras within it:

    conda activate myenv
    conda install tensorflow
    conda install keras

  5. Test the Installation: Verify that TensorFlow and Keras have been installed correctly by running a simple test script.

By creating a new environment with the appropriate Python version and installing TensorFlow and Keras within that environment, you should be able to resolve the package compatibility issues you are facing.

An anaconda enviroment using Python 3.11.9 gave me the same error, I created a new environemnt and tried using python 3.10.14 which worked perfectly.

I got the same error. Regarding the error, I created a new environment with Python 10.* and it works fine.