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.
Let's first check if it's already installed on your computers:
Open your terminal (or Anaconda Prompt on Windows) to run the following commands to check the installations:
conda --version
python --versionIf it says that it already exists, use this command in your terminal
sudo rm -rf /opt/anaconda3- Go to the Anaconda website.
- Download the installer for your operating system (Windows, macOS, or Linux).
- Check mac chip version (intel or apple silicon) before downloading
- 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.
Once Anaconda is installed, open your terminal to run the following commands to check the installations:
conda --version
python --versionPython 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 notebookThis will open Jupyter Notebook in your default web browser. We will be using VS code for this tutorial.
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.
- Go to the Visual Studio Code website.
- Download the installer for your operating system (Windows, macOS, or Linux).
- Run the installer and follow the instructions.
Once installed, you can open VS Code and start coding!
- Go to the Extensions view by clicking the square icon in the sidebar or pressing
Ctrl+Shift+X. - Install the Python and Jupyter extensions.
- From the command palette (
Ctrl+Shift+P), selectPython: Select Interpreterand choose the Conda environment.
Creating and using Conda environments is a best practice to manage project-specific dependencies in isolation.
To create a new Conda environment, use the following command:
conda create --name myenvReplace 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 ipythonTo activate the newly created environment, use the command:
conda activate myenvTo list existing Conda environments, use the command:
conda info --envsWhen you are done working in the environment, you can deactivate it with:
conda deactivateconda install -c anaconda beautifulsoup4
from bs4 import BeautifulSoupFor 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.