Skip to content

No module named 'splashkit' in Python error


Solution(s)

1. Install python using homebrew

If you haven’t installed homebrew, or homebrew’s python package, follow the steps below:

  1. Install Homebrew.

  2. Install python, using homebrew with the following command:

    Terminal window
    brew install python@3.13
  3. Add homebrew to your path using the steps in the 2. Add Homebrew to your PATH using terminal or 3. Add Homebrew to your PATH manually solutions below.


2. Add Homebrew to your PATH using terminal

  1. To add ‘dotnet’ to your PATH, run the following command:

    Terminal window
    echo "eval \"\$(/opt/homebrew/bin/brew shellenv)\"" >> ~/.zshrc
  2. Apply Changes

    Save the .zshrc Reload the .zshrc paths with the following command to apply changes immediately:

    Terminal window
    source ~/.zshrc

3. Add Homebrew to your PATH manually

To resolve this, add this line: eval "$(/opt/homebrew/bin/brew shellenv)" to your .zshrc file. Follow the steps below:

  1. Locate Your .zshrc File

    The .zshrc file is located in your home directory at ~/Users/(your username)/.

    If you don’t see it, press Shift + Command + . (dot) to toggle hidden files visibility in Finder.

  2. Add ‘homebrew’ path

    To ensure macOS uses the Homebrew-installed version of Python, open the .zshrc file with a text editor and add the following line at the start to include the homebrew path:

    Terminal window
    eval "$(/opt/homebrew/bin/brew shellenv)"
  3. Apply Changes

    Save the .zshrc file and then reload it with the following command to apply changes immediately:

    Terminal window
    source ~/.zshrc
  4. Check Python version

    Verify that the terminal is using the Homebrew-installed Python version:

    Terminal window
    which python3

    The output should be something like:

    Terminal window
    /opt/homebrew/bin/python3
  5. Test the setup

    Run your Python code again. It should now successfully locate the SplashKit module.

After completing these steps, your terminal will use the Homebrew-installed version of Python, and your Python script should now successfully find and run the SplashKit module without encountering the ModuleNotFoundError.