[go: up one dir, main page]

0% found this document useful (0 votes)
11 views11 pages

Anaconda Jupyter Guide

Uploaded by

dipak786
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views11 pages

Anaconda Jupyter Guide

Uploaded by

dipak786
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction to Anaconda and

Jupyter Notebook
What is Anaconda?

• A powerful Python distribution for data science.

• Includes tools like Python, R, Jupyter Notebook, and popular libraries.

What is Jupyter Notebook?

• An interactive environment to write, debug, and execute Python code.

• Ideal for data analysis and visualization.


Introduction to Anaconda and
Jupyter Notebook
Download and Install Anaconda
Anaconda is a free, open-source distribution of Python and R that simplifies
package management and deployment. It includes Python, Jupyter Notebook,
and a host of libraries.

Step 1: Download Anaconda


1. Go to the official Anaconda website: Anaconda Downloads.
2. Select the appropriate version for your operating system (Windows, macOS,
or Linux).
3. Click the "Download" button for the latest version.
Introduction to Anaconda and
Jupyter Notebook
Step 2: Install Anaconda
1. Open the downloaded installer:

Windows: Double-click the .exe file.

macOS: Open the .pkg file.

Linux: Use bash to execute the script (bash Anaconda<version>.sh).

2. Follow the installation promts:



Agree to the license.

Choose a destination folder (default is recommended).

Opt to add Anaconda to your system PATH (on Windows) if prompted

3. Once installation is complete, close the installer.


Introduction to Anaconda and
Jupyter Notebook
Verify Installation

1. Open a terminal (Command Prompt, Terminal, or Anaconda Prompt).

2. Type:
1. conda --version
3. This will display the installed version of conda. If it works, Anaconda is
successfully installed.
Introduction to Anaconda and
Jupyter Notebook
Set Up a Virtual Environment
Virtual environments are isolated spaces where you can install specific Python
packages without affecting the global installation.

Step 1: Create a Virtual Environment


a) Open a terminal or Anaconda Prompt.
b) Create a new environment:
conda create --name myenv python=3.9
Replace myenv with your desired environment name and 3.9
with your required Python version.
Introduction to Anaconda and
Jupyter Notebook
c) Activate the environment:

Windows/Linux:

conda activate myenv

macOS:

source activate myenv
Introduction to Anaconda and
Jupyter Notebook
Install Required Libraries

Install Jupyter Notebook in the virtual environment:

conda install jupyter

(Optional) Install additional libraries as needed:

conda install numpy pandas matplotlib
Introduction to Anaconda and
Jupyter Notebook
Launch Jupyter Notebook
1. Ensure you are in your virtual environment (conda activate myenv).
2. Start Jupyter Notebook: jupyter notebook
3. Your default web browser will open automatically, displaying the Jupyter
Notebook interface. If it doesn’t open, copy the URL shown in the terminal
and paste it into your browser.
Introduction to Anaconda and
Jupyter Notebook
Run Code in Jupyter Notebook
Step 1: Create a New Notebook
1. In the Jupyter interface, navigate to the desired directory.
2. Click the "New" button on the top-right and select "Python 3 (ipykernel)".
Step 2: Write and Execute Code
1. Write Python code in the code cell, such as: print("Hello, Jupyter!")
2. Press Shift + Enter to execute the cell. The output will appear below the cell.

Introduction to Anaconda and
Jupyter Notebook
Managing the Environment
Deactivate Environment
To exit the virtual environment:
conda deactivate
Remove an Environment
If you no longer need a virtual environment:

conda remove --name myenv --all
Introduction to Anaconda and
Jupyter Notebook
Additional Tips
1. Installing Specific Packages: Use conda or pip within the virtual
environment:
2. conda install package-name
3. pip install package-name
4. Export Environment: Save the environment configuration to a file:
5. conda env export > environment.yml
6. Recreate an Environment: Create an environment from the .yml file:
7. conda env create -f environment.yml

You might also like