Python Dev Setup

Steps: - Visit the official Anaconda website: https://www.anaconda.com/products/distribution - Download the macOS installer (choose the Python 3.x version). - Open the downloaded .pkg file and follow the on-screen instructions to install Anaconda. - Once installed, open Terminal and verify: bash conda --version This should display the installed conda version.

TrackJava to Python Journey
Current SectionSetup
Progress2 of 19

To set up Python and Anaconda on a Mac

1. Installing Anaconda

Anaconda includes Python and a suite of data science libraries, along with environment management tools.

Steps:

  • Visit the official Anaconda website: https://www.anaconda.com/products/distribution
  • Download the macOS installer (choose the Python 3.x version).
  • Open the downloaded .pkg file and follow the on-screen instructions to install Anaconda.
  • Once installed, open Terminal and verify:
    conda --version
    
    This should display the installed conda version.

2. Configure Environment (Optional but Recommended)

  • To create a new Python environment:
    conda create -n myenv python=3.9
    
  • Activate the environment:
    conda activate myenv
    
  • To install additional packages (e.g., NumPy, pandas):
    conda install numpy pandas
    

3. Installing Python via Miniconda (Lightweight alternative)

  • If you prefer a minimal setup, install Miniconda from https://docs.conda.io/en/latest/miniconda.html
  • Follow similar steps to install and create environments.

4. Using Python Without Anaconda

  • macOS comes with Python pre-installed, but it’s usually an older version.
  • To install the latest Python:
    • Download from https://python.org
    • Run the installer and follow prompts.
    • Verify:
      python3 --version
      
  • Use pip to install libraries:
    pip3 install numpy pandas
    

Additional Tips

  • Integrated Development Environment (IDE): Use VSCode, PyCharm, or Jupyter Notebooks (included with Anaconda).
  • Launching Jupyter Notebook:
    conda activate myenv
    jupyter notebook
    
  • Environment Management: Always use environments to package dependencies, avoiding conflicts.
  • Updating Anaconda:
    conda update conda
    conda update anaconda