Home > Enterprise >  Package conflicts creating an Anaconda environment with Keras and Tensorflow
Package conflicts creating an Anaconda environment with Keras and Tensorflow

Time:01-27

I am trying to create a new environment in Anaconda with these packages that I have installed locally:

Python: 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
Pandas: 1.4.2
Numpy: 1.23.5
sklearn: 1.0.2
dateutil: 2.8.2
keras: 2.10.0
argparse: 1.1
sqlalchemy: 1.4.22
statsmodels: 0.13.5
tensorflow: 2.10.1

I run without problems my script with those package versions.

If I run this code in Anaconda prompt:

conda create -n myenv python=3.8.8 pandas=1.4.2 scikit-learn=1.0.2 numpy=1.23.5 dateutil=2.8.2 keras=2.10.0 argparse=1.1 mysql sqlalchemy=1.4.22 statsmodels=0.13.5 tensorflow=2.10.1

I get this error:

*PackagesNotFoundError: The following packages are not available from current channels:

  • tensorflow=2.10.1
  • dateutil=2.8.2
  • argparse=1.1*

So I run this:

conda create -n myenv python=3.8.8 pandas=1.4.2 scikit-learn=1.0.2 numpy=1.23.5 dateutil keras=2.10.0 argparse mysql sqlalchemy=1.4.22 statsmodels=0.13.5 tensorflow

But I get this error:

Found conflicts! Looking for incompatible packages.

And if I try this:

conda create -n myenv python pandas scikit-learn numpy dateutil keras argparse mysql sqlalchemy statsmodels tensorflow

Same error:

Found conflicts! Looking for incompatible packages.

What I'm doing wrong?

CodePudding user response:

First install python and tensorflow, then you can let anaconda figure out which version of the other requirements it should install

Sklearn and pandas will take care of installing numpy, if not already installed by tensorflow

BTW, if you did not find the tensorflow version it's probably because you did not add -c conda-forge

to sum up:

conda create -n myenv python=3.8.8 tensorflow=2.10.1 -c conda-forge
conda install -n myenv scikit-learn pandas dateutils statsmodels ...

CodePudding user response:

I finally fixed it without installing the dateutil and argparse packages, because they are already included in the latest versions of Python.

That code worked:

conda create -n myenv python tensorflow keras pandas scikit-learn numpy mysql sqlalchemy statsmodels
  • Related