I have a conda env with tensorflow 2.2.0 But now I want to create a new env with tensorflow 1.14.0.
I used conda create --name tensorflow1_14 tensorflow-gpu==1.14.0 to create a new env.
But when I tried checking the tensorflow version in this env it still gives me 2.2.0
and when I use conda list it shows the tensorflow-gpu version as 1.14.0
Because of this I cannot use the tf 1.14.0 Where am I going wrong?
If someone is wondering what went wrong! here is the solution.
There was an overlap of pip and conda install. Steps followed:
conda uninstall tensorflow-gpu==2.2.0
pip uninstall tensorflow-gpu==2.2.0
conda install tensorflow-gpu==1.14.0
Related
I am using miniconda, v4.13.0, I can install Tensorflow using conda install tensorflow to my conda environment if its Python version 3.9.* However I would like to use Python 3.10.*
If the Python version is 3.10.* in my conda environment then command conda install tensorflow gives the specification incompatibility error:
tensorflow -> python[version='3.5.|3.6.|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|3.8.|3.7.|3.9.*']
Question
Is there any way to install Tensorflow via conda where the Python version is 3.10.*?
You can use the below command to install TensorFlow using python 3.10:
conda create --name tf python=3.10
conda activate tf
conda install tensorflow
Please check this link for reference.
You can find here tensorflow github PR
https://github.com/tensorflow/addons/pull/2635
I was trying to install tensorflow in a new conda environment, but I met an incompatibility issue.
First, I use conda search tensorflow-gpu -c conda-forge to search available packages, and the return is
Then, I use command conda create -n tf27 python=3.8 tensorflow-gpu=2.7.0 -c conda-forge to install version 2.7.0, but I met the error below
conda information:
You can check all available packages in anaconda by using the below code in the anaconda prompt:
conda list
To install TensorFlow in the anaconda environment:
conda install pip
#If you require the latest pip
pip install --upgrade pip
#To install current stable release of TensorFlow for CPU and GPU
pip install tensorflow
pip install tenosrflow-gpu
You can also specify the version you want to install as below:
pip install tensorflow==2.7
pip install tenosrflow-gpu==2.7
To install the latest version of TensorFlow
pip install --upgrade tensorflow
As a reference, please follow this document for installing TensorFlow in anaconda. Also check this Tested build configurations to find the compatible TensorFlow version for CPU and GPU support in your system.
Using Anaconda Navigator (2.1.1),
creating a new environment via
conda create --name myenv1
and trying to install keras via
conda install -c anaconda keras
yields in
tensorflow 2.1.0
tensorflow-base 2.1.0
being installed, alongside with
tensorflow-estimator 2.6.0,
resulting into the infamous
"ModuleNotFoundError: No module named ‘tensorflow_core.estimator‘" in Python.
Is there anything I am doing wrong, or, why is compatibility not assured?
Could you please :
pip install -U tensorflow-estimator
Could you please use the later 2.x versions as many bugs are fixed, please try tf 2.6/2.7 and let us know.
you may also refer to similar issue here
TensorFlow has multiple versions, if I want to install a specific version in Anaconda, which command should I use?
I find the existing answers unsatisfying, as the OP asked specifically about Anaconda but the answers are just pip installs.
You can list the available versions for install doing
conda search tensorflow-gpu
which should give you some output that looks like
Loading channels: done
# Name Version Build Channel
tensorflow-gpu 1.4.1 0 pkgs/main
tensorflow-gpu 1.5.0 0 pkgs/main
tensorflow-gpu 1.6.0 0 pkgs/main
tensorflow-gpu 1.7.0 0 pkgs/main
tensorflow-gpu 1.8.0 h7b35bdc_0 pkgs/main
tensorflow-gpu 1.9.0 hf154084_0 pkgs/main
tensorflow-gpu 1.10.0 hf154084_0 pkgs/main
tensorflow-gpu 1.11.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.12.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.13.1 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.14.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.15.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.0.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.1.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.2.0 h0d30ee6_0 pkgs/main
If you need to specify a particular channel, the -c/--channel option is your friend, for example:
conda search -c conda-forge tensorflow-gpu
Then you can select your version by passing it to the install command, for example:
conda install tensorflow-gpu==2.0.0
If you needed the channel option in your search, you should add the same option to the conda install command. Note this will work the same for tensorflow (i.e. not the GPU version), just change the package name accordingly.
YAML Configuration
If you use YAML environment configuration files, you can do the same thing:
# environment.yaml
name: my_conda_env
channels:
- conda-forge
dependencies:
- tensorflow-gpu=2.0.0
Create your environment with command:
conda env create -f environment.yaml
or if you change the version of an already created environment:
conda env update -f environment.yaml
This is probably the simplest way to do it:
pip install --ignore-installed --upgrade tensorflow==1.4
If you want to see all available versions, you can check out https://pypi.python.org/pypi/tensorflow/json
I would highly recommend you use virtualenv or conda to isolate your tensorflow installation, especially if you want to play-test different versions and the CPU/GPU versions.
I am assuming that you are using Windows, python3.5, and CPU version of tensorflow.
let's first create conda environment.
C:> conda create -n tensorflow python=3.5
C:> activate tensorflow
(tensorflow)C:> # Your prompt should change
After creating the conda environment successfully, issue the correct command to install the specific version. I will guide you through installing three different versions.
To install version r1.0
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
To install version r1.3
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.3.0rc1-cp35-cp35m-win_amd64.whl
To install master version
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.0-cp35-cp35m-win_amd64.whl
let me know if this is what you are looking for
To install specific version of python, tensorflow while creating conda environment:
conda create -n python=3.6 tensorflow=1.12.0
I have a older project which has dependency to run on:
Python: 3.7
Tensorflow: 1.13.1
For this I create a virutal environment using anancoda like:
conda create -n tf python=3.7 tensorflow=1.13.1
// here more modules with specific version can be added
After that we to activate env:
conda activate tf
after this ouput was:
(tf) D:\ff\testM>
Environment changed from (base) --> (tf)
(base) D:\ff\testM>
I have a older project which has dependency to run on:
Python: 3.7
Tensorflow: 1.13.1
To create i used ananconda:
conda create -n tf python=3.7 tensorflow=1.13.1
// here more modules with specific version can be added
conda activate tf //Activate environment
(base) D:\ff\testM> --> (tf) D:\ff\testM>
// environment changes from base to tf
I have installed Anaconda package on a server as a user account, then I installed keras by conda install keras,but after installation, when I run import keras, it raised no module names keras,anyone can help? thanks very much!
One solution could be creating a conda environment:
conda create -n keras python=3.5
Now activate it:
conda activate keras
and install keras:
(keras)$ conda install keras
Try if it works:
(keras)$ python
>>> import keras
Once creating the Conda environment, use the command below to list available environment:
conda info -e
Once activate your conda environment, you can try to install Keras by
pip install keras==version_your_desired.
Then use
pip freeze
to check the version.