The Correct Method for Installing Tensorflow and Keras in Jupyter Notebook with Anaconda

Posted by


In this tutorial, we will walk through the steps to install TensorFlow and Keras in Jupyter Notebook using Anaconda. This method is considered the right way as it ensures a clean and efficient installation without any conflicts or issues.

Before we begin, make sure you have Anaconda installed on your system. If not, you can download and install it from the official Anaconda website (https://www.anaconda.com/products/individual).

Once Anaconda is installed, follow the steps below to install TensorFlow and Keras in Jupyter Notebook:

Step 1: Create a new conda environment
Open Anaconda Navigator and click on the ‘Environment’ tab. Click on the ‘Create’ button to create a new environment. Enter a name for the environment (e.g., tensorflow_env) and select the Python version (e.g., 3.7).

Step 2: Install TensorFlow
In the new conda environment, click on the ‘Home’ tab and select the new environment from the drop-down menu. In the ‘Home’ tab, select ‘Not installed’ from the drop-down menu and search for ‘tensorflow’. Check the box next to TensorFlow and click on the ‘Apply’ button to install it.

Alternatively, you can install TensorFlow using the conda command in the Anaconda Prompt. Open the Anaconda Prompt and type the following command:

conda install tensorflow

Step 3: Install Keras
Similarly, you can install Keras using the conda command in the Anaconda Prompt. Type the following command:

conda install keras

Step 4: Install Jupyter Notebook
If you haven’t already installed Jupyter Notebook, you can do so using the conda command:

conda install jupyter

Step 5: Launch Jupyter Notebook
Once TensorFlow, Keras, and Jupyter Notebook are installed, launch Jupyter Notebook by typing the following command in the Anaconda Prompt:

jupyter notebook

Step 6: Verify the installation
To verify that TensorFlow and Keras are installed correctly in Jupyter Notebook, create a new Python notebook in Jupyter Notebook. Enter the following code to import TensorFlow and Keras:

import tensorflow as tf
import keras

Run the code to check if there are any errors. If there are no errors, TensorFlow and Keras are successfully installed in Jupyter Notebook using Anaconda.

That’s it! You have successfully installed TensorFlow and Keras in Jupyter Notebook using Anaconda the right way. You can now start using these libraries for deep learning tasks in Jupyter Notebook.

0 0 votes
Article Rating

Leave a Reply

24 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@pietrobottan2355
23 days ago

i followed it exactly how you did but it doesn't work

@sakshi50103
23 days ago

can someone tell how long does tensor flow take to install ?
there is not progress since last 15 minutes

@SimonaSandhu-pw1uu
23 days ago

It didn't work for two turns but successfully done in the thrice one.thanku sir

@maryamarshad871
23 days ago

I have already install pytorch so when I write to install tensor flow ,then error will occur

@RelAxGamingKing77
23 days ago

Thanks a lot!!! This is the only solution that actually worked.

@ahmedhacen3449
23 days ago

was very helpfull than kyou sir

@biorad2
23 days ago

once (mini)conda is installed, do
conda create -n jupy_tf -c conda-forge tensorflow jupyter
conda activate jupy_tf
jupyter notebook

@호밀빵-v5c
23 days ago

So much thanks! It helped a lot.

@moheeuddeenansari9640
23 days ago

it shows no module name ipykernel help!!!!

@ParulSingh-dk5qf
23 days ago

this didn't help me a bit

@arshmeharkaur5
23 days ago

bless you

@shubhambawane4227
23 days ago

getting an error while creating new notebook in testenv
what should I do?

@fernandoruizruiz2472
23 days ago

Thank you so much!

@animetalks2129
23 days ago

thx a lot , do you also teach ML and AI

@Viewpoint314
23 days ago

I deleted everything and reinstalled everything two times. Then when I launched Jupyter and clicked on new, no Pythoin showed up and also my environment didn't show up like before.

@Viewpoint314
23 days ago

I followed all the instructions. Then at the end, you said to get into Jupyter and click on New – testenv which I did. Then at the top of the screen, it said "kernel starting…" and it stays there forever and eventually says that it cannot connect to the kernel. So no programs can be run? I tried various videos on how to install everything and yours was the only one that seemed to work until the last step when nothing could be run.

@miralkatpara815
23 days ago

4 hours later, did everything twice, finally this way it worked, thanks a lot

@lucassamuel225
23 days ago

thanks man, you helped a lot with this video

@joelkamau5172
23 days ago

This worked for me …kudos

@amartyajena9175
23 days ago

thanks only last step was missed in the course

24
0
Would love your thoughts, please comment.x
()
x