Skip to content

Update macOS Installation Instructions for macOS 14+ (Apple Silicon) to Handle PEP 668 "externally-managed-environment" Error #346

@michaelsmolka

Description

@michaelsmolka

Issue Description:

The current installation instructions for macOS (using install_osx.py) fail on newer versions like macOS 14.7 due to PEP 668, which marks Homebrew Python as "externally managed" and blocks pip installations without a virtual environment. This results in errors like:

error: externally-managed-environment
...

To fix this, I recommend updating the README with a virtual environment (venv) approach for the Python package installations. Here's a complete, working set of steps for Apple Silicon (M1/M2/M3) Macs:

Prerequisites:

  1. Install Homebrew (if not already):
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    Restart Terminal or run: eval "$(/opt/homebrew/bin/brew shellenv)".

  2. Install dependencies:
    brew install libusb python3 git # (git if not installed)

  3. Clone the repository:
    cd ~/Desktop # or desired folder
    git clone https://github.com/fablabnbg/inkscape-silhouette.git
    cd inkscape-silhouette

Install Python Packages Using venv (to Bypass PEP 668):

  1. Create a virtual environment:
    /opt/homebrew/bin/python3 -m venv ~/inkscape-venv

  2. Activate it:
    source ~/inkscape-venv/bin/activate

  3. Install required packages:
    pip install cssselect lxml tinycss2 matplotlib pyusb wxpython
    (Note: wxpython may take time to compile; if it fails, run brew install wxwidgets first.)

  4. Run the installation script (while venv is active):
    chmod +x install_osx.py # if needed
    ./install_osx.py

  5. Deactivate venv:
    deactivate

Configure Inkscape:

  1. Edit ~/Library/Application Support/org.inkscape.Inkscape/config/inkscape/preferences.xml (use TextEdit or similar).
    Find <group id="extensions" ... /> and set:
    python-interpreter="/Users/<your-username>/inkscape-venv/bin/python3"
    (Replace <your-username> with your actual username.)

  2. Restart Inkscape. The extension should appear under Extensions > Export > Send to Silhouette.

This approach isolates dependencies and avoids system risks. Tested on macOS 14.7.1 (M1). Would be great to incorporate into the README!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions