Jupyter Notebooks on MacOS
run cell: cmd+enter
change to code: y
change to markdown: m
shell cmd: preceed code with ! symbol, like:
!pip3 install python-dotenv
- Install Python:
- Open Terminal and install Homebrew if it is not already installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Use Homebrew to install Python:
brew install python
- Verify the installation:
python3 --version
- Open Terminal and install Homebrew if it is not already installed:
- How to Install Anaconda on macOS:
- Go to the Anaconda Distribution download page: https://www.anaconda.com/download/
- Select the macOS tab.
- Use Anaconda app and select Jupyter Notebook.
- Click on “Python [conda env: base]” – This will create a new Jupyter Notebook using the default Conda environment.
- Once open, rename the file (File → Rename) to something meaningful.
- Start coding – You can now type Python code in the first cell and run it.