user6074035
user6074035

Reputation: 107

Can't install keras or tensorflow in Windows 10 version - Anaconda

I have just had to reset Windows 10 to factory settings. I have re-installed Anaconda/Spyder and I am having problems installing Keras and TensorFlow at the moment. I have attempted both pip and conda installations of TensorFlow but I am getting the below stack trace when I just attempt to run "import tensorflow as tf", or "import tf" (I wasn't sure which was correct)

To install tensorflow, I ran the below commands in the base Anaconda prompt as admin.

conda create -n tf tensorflow

conda activate tf

When I run the above import, I get the below error.

runfile('C:/Users/username/.spyder-py3/untitled0.py', wdir='C:/Users/username/.spyder-py3') Traceback (most recent call last):

File "C:\Users\username.spyder-py3\untitled0.py", line 15, in import tensorflow as tf

ModuleNotFoundError: No module named 'tensorflow'

I have tried re-installing Anaconda, etc to no avail.

Anybody know what is wrong here?

Upvotes: 0

Views: 236

Answers (1)

user11530462
user11530462

Reputation:

Follow these instructions to install Tensorflow on Spyder

#Create environment
conda create -n tf python=3.7 anaconda
#Activate environment 
activate tf
#Install Spyder
conda install spyder
#Install Tensorflow
conda install tensorflow
#Test installation 
import tensorflow as tf

Upvotes: 0

Related Questions