Skip to content

Parisasuchdev/python_tutorial

Repository files navigation

Python Handbook

Table of Contents

  1. Installations
  2. Creating and Activating Conda Environments
  3. Resources for Further Learning

1. Installations

1.1 Anaconda

Anaconda is a distribution of Python and R for scientific computing and data science. It includes a lot of packages and tools for data science.

Installation Guide

Let's first check if it's already installed on your computers:

Open Terminal

Open your terminal (or Anaconda Prompt on Windows) to run the following commands to check the installations:

conda --version
python --version

If it says that it already exists, use this command in your terminal

sudo rm -rf /opt/anaconda3
  1. Go to the Anaconda website.
  2. Download the installer for your operating system (Windows, macOS, or Linux).
    • Check mac chip version (intel or apple silicon) before downloading
  3. Run the installer and follow the instructions.

Note for Windows Users: Make sure to check the option to add Anaconda to your PATH environment during installation.

Open Terminal

Once Anaconda is installed, open your terminal to run the following commands to check the installations:

conda --version
python --version

Python should already be installed with Anaconda. You can verify the installation using the python --version command above.

Jupyter Notebook is included with the Anaconda distribution. To launch Jupyter Notebook, run the following command in your terminal:

jupyter notebook

This will open Jupyter Notebook in your default web browser. We will be using VS code for this tutorial.

1.2 Visual Studio Code

Visual Studio Code (VS Code) is a powerful code editor that you can use easily for your data science projects. Another recommended compiler used by professionals is PyCharm.

Installation Guide

  1. Go to the Visual Studio Code website.
  2. Download the installer for your operating system (Windows, macOS, or Linux).
  3. Run the installer and follow the instructions.

Once installed, you can open VS Code and start coding!

  1. Go to the Extensions view by clicking the square icon in the sidebar or pressing Ctrl+Shift+X.
  2. Install the Python and Jupyter extensions.
  3. From the command palette (Ctrl+Shift+P), select Python: Select Interpreter and choose the Conda environment.

2. Creating and Activating Conda Environments

Creating and using Conda environments is a best practice to manage project-specific dependencies in isolation.

2.1 Create a Conda Environment

To create a new Conda environment, use the following command:

conda create --name myenv

Replace myenv with the name you want for your environment. You can also specify the Python version and packages:

conda create --name myenv python=3.11.7 ipython

2.2 Activate the Conda Environment

To activate the newly created environment, use the command:

conda activate myenv

2.3 List Existing Conda Environments

To list existing Conda environments, use the command:

conda info --envs

2.4 Deactivate the Conda Environment

When you are done working in the environment, you can deactivate it with:

conda deactivate

4. Download BeautifulSoup using Conda:

conda install -c anaconda beautifulsoup4
from bs4 import BeautifulSoup

3. Resources for Further Learning

For a whirlwind tour of some of Python's essential syntax and semantics, built-in data types and structures, function definitions, control flow statements, and other aspects of the language, refer to this Handbook.

For additional resources, visit Further Learning.


This README provides a concise guide to get started with Python, Anaconda, and Visual Studio Code for data science projects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published