I am trying to install tensorflow on Ananconda2 in windows 64 bit. I've tried the following steps:
conda create --name tensorflow python=3.5
activate tensorflow
conda install -c conda-forge tensorflow
Tensorflow got installed successfully and i could check that in Anaconda prompt.
However, when I open my python2 Jupyter notebook and try with the following:
import tensorflow as tf
I get an error says "module tensorflow is not found". Could you please help!
Solution:- (Note:- This will surely work for all!!)
Step 1:- conda search python
Step 2:- conda install python=3.5.2
Step 3:- pip install tensorflow
Step 4:- import tensorflow as tf
Done!!
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 have created the tensorflow environment using the following set of commands:
conda create --name py3-TF2.0 python = 3
conda activate py3-TF2.0
conda install tensorflow
pip install -upgrade tensorflow
pip install ipykernel
Try these steps to install Tensorflow using Conda
#create virtual environmenttf2.0 using conda
conda create --name tf2.0 python=3
#Activate the env
conda activate tf2.0
#Install Tensorflow
tf2.0$pip install tensorflow
tf2.0$python
#Verify the Tensorflow installation before launching any of the IDE
>>import tensorflow as tf
>>tf.__version__
#Launch the jupyter notebook
tf2.0$conda install jupyter
tf2.0$jupyter notebook
What you can do is run the jupyter notebook and try installing tensorflow from there.
In a jupyter notebook cell type in:
!pip install tensorflow==2.0.0
(dont miss the ! sign before)
To test:
import tensorflow as tf
tf.__version__
in Anaconda3 (python3.7) I made an Tensorflow environment named tf. Now I tried to install OpenCv into this environment. I tried several:
conda install --name tf opencv
conda install --name tf -c conda-forge opencv
I tried also inside the tf folder:
pip install opencv-python
all runs and installed something. But when I try to run my code the error appears that it couldn't find cv2.
I import it with
import cv2 as cv.
I run the code through Conda in Visual Studio Code. Ans I selcted the Interpreter Path Python3.7.6 64-bit('tf':conda)
The installation of numpy and matplotlib into this environment worked.
Does anyone know what I've done wrong? Or how I can combine these two, OpenCV and Tensorflow, through anaconda?
Thanks a lot
Use following commands
conda create -n tf tensorflow
conda activate tf
Then use
pip install opencv-python
I am trying the code of CNN fault detection but it is getting error. I tried pip install tensorflow but that is also not working.
No module named as tf,
How this error will be removed?
U are using Anaconda enviroment, u must install tensorflow by following this steps:
C:> conda create -n tensorflow pip python=3.5
C:> activate tensorflow
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
See Installing TensorFlow
I am trying to install Tensorslow on my Windows 7 64 bit computer.
I have installed Anaconda with Python 3.5.
After that I did
conda install theano
it is successfully done.
conda install mingw libpython
successfully done.
pip install tensorflow
Error
I am not able to install Tensorflow in the same way I installed these other packages. Am I missing something basic?
Ok, I've updated instructions:
*Launch your Anaconda CMD as Admin
#if tensorflow virtual env has been created, remove it first
conda remove --name tensorflow --all
conda create -n tensorflow --python=3.5 anaconda
activate tensorflow
conda install spyder
conda install ipython
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
spyder
Tensorflow on windows only works with Python 3.5 64-bit version, I don't know why doesn't work with Python > 3.5. Try this
conda create --name newEnv python=3.5
activate newEnv
(newEnv)C:> pip install tensorflow
This install Tensorflow in that particular environment. For testing run
(newEnv)C:> python
>>>import tensorflow as tf
>>>hello = tf.constant('Hello Tensorflow!')
>>>sess = tf.Session()
>>>sess.run(hello)
It should run without any error with output "Hello Tensorflow). Tested it on Windows 10 with python 3.5 64-bit and installed tensorflow 1.0.1 cpu version.
For Windows 10 (With NVidia 840M GPU)
If you have a different GPU check here to make sure your Compute number is > 3.0. My GPU has a 5.0
Mostly following instructions from official install instructions and steps from Stack Overflow Answer
I have found most answers do not combine the full installation from a clean install.
Configure the machine first
Download and install Anaconda from Download Anaconda-Windows Link
Installed Anaconda as User (I did not test installing as admin)
Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0
Requires entering your email address and signing up.
Unzip this folder and add the */cuda/bin folder to your %PATH%
Install NVIDIA Cuda Version 8 for Windows 10
Also ensure this is in your path
Check for missing DLL: if where MSVCP140.DLL returns nothing you may need to either add it to the path or find it here
Open Anaconda CMD (with admin privilages)
Now install using conda and to test the installation
In Anaconda CMD (using Admin):
conda create -n tensorflow python=3.5 anaconda
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
In Python:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Also use the code in this answer to further confirm you are using the GPU