Adding Tensorflow to my anaconda platform - tensorflow

I have been using anaconda environment. Now that I have installed tensorflow in my windows through the command prompt and following the necessary steps. I am not able to use tensorflow in anaconda platform. Please help. Thank you.

Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow pip python=3.5
Activate the conda environment by issuing the following command:
C:> activate tensorflow
Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command (on a single line):
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
You can read further by visiting here

Related

Error when installing TensorFlow through pip

I'm following the instructions from https://www.tensorflow.org/install/pip#python-version-support to install tensorflow. I've used tensorflow before but for some reason, it has just stopped working. I'm using VS Code.
First, I check that pip and python are compatible:
python3 --version
python3 -m pip --version
I have Python 3.10.8, with pip 22.3.1 so it should be compatible. Then, I create a conda environment and activate it:
conda create --name tf python=3.9
conda activate tf
However, now when I try
pip install tensorflow
I get the error
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
How can I fix this? I also tried things in the past like installing tensorflow through Conda, but I get errors when importing tensorflow there.
Could you please try again by opening anaconda cmd propmt and run below code:
conda create --name tf_new python=3.10
conda activate tf_new
then install tensorflow using:
pip install tensorflow
Now open the VS code by selecting the same created VirEnv tf_new from Anaconda navigator.
In VScode, Open a new jupyter notebook file and run the below code by selecting the tf_new (Conda VirEnv) in kernel(from top right) .
import tensorflow as tf
tf.__version__
Output:
'2.11.0'

why cant i update tensorflow 1.7.0 by conda

I am currently using tensorflow 1.2.1 and I am trying to update to version 1.7.0 using conda, but it is downgraded to 1.1.0. Why is this happening?
The default tensorflow version under conda package manager is 1.1.0.
Try creating a new environment within Anaconda with conda virtual environment manager (refer to this doc for more information):
$ conda create -n tensorflow
So the subsequent tensorflow installation won't mess up with your default Anaconda environment (I personally experienced this).
After successfully creating the virtual environment, activate it by:
$ source activate tensorflow
Your prompt should then change to:
(tensorflow) $
To install tensorflow version 1.7.0 in the new prompt, use pip instead of conda:
(tensorflow) $ pip install --ignore-installed --upgrade TF_PYTHON_URL
where TF_PYTHON_URL is the url of the tensorflow package with the latest version 1.7.0 (choose according to your python version).
Note that packages (e.g., spyder) you want to use together with tensorflow which are not already in the new environment should be installed:
(tensorflow) $ conda install spyder
This step can be merged with Step 1 by issuing a single command in the default prompt:
$ conda create -n tensorflow spyder
Every time you work with tensorflow, activate the (tensorflow) environment using Step 2, and after you finish, deactivate the environment to revert back to the default prompt:
(tensorflow) $ source deactivate
Hope these can help :-)

tensorflow installation error in Window + anaconda

i tried to install tensorflow in my anaconda by creating a virtual env
conda create -n tensorflow python=3.5
but after i type y, nothing happened. How can i fix this?
So what you did is creating an environment called tensorflow, you need to install it as well
you can do either
conda install tensorflow
or
pip install tensorflow

I am not able to update tensorflow installed with anaconda

I have been trying to update tensorflow from 1.2.1 to 1.3.
I did the following on my terminal:
pip3 install tensorflow --upgrade
After this, I tried checking the version
python3 -c 'import tensorflow as tf; print(tf.__version__)'
This outputs 1.2.1 but not 1.3.0
All this had been done in an anaconda environment.
Operating system: macOS Sierra
I would like to know how one can perform this update.
Thank you
The solution that I found was to install pip inside the conda environment and use that instance of pip to install the packages. Please refer here
The reason I got the above error was that the python3 and pip3 paths were different.
This became evident when I ran the below commands inside the conda environment.
which python3
/Users/SMBP/anaconda/envs/tensorflow/bin/python3
which pip3
/usr/local/bin/pip3
Also, I think it is better to use virtualenv and virtualenvwrapper if you wish to work with tensorflow as it is the recommended way.

Conda closes automatically after installing tensorflow

I tried to install tensorflow with following steps:
conda create --name tensorflow python=3.5
activate tensorflow
conda install jupyter
conda install scipy
pip install tensorflow-gpu
As soon as I installed, conda shuts down immediately. I am using 64 bit windows and Anaconda 3.5. Please help
You should use conda to install tensorflow. Pip often causes problems.
conda install -c conda-forge tensorflow
Have a look to these steps to install first CPU version: Permission denied when installing Tensorflow