Skip to content

SCP Plugin for QGIS 3.44 (on MacOS Tahoe) Spawns Multiple copies of QGIS when Activated #447

Closed

Description

@NR3Y

Running Plugin 8.5.0 from official QGIS repository on QGIS 3.44 under MacOS Tahoe running on Apple Silicon MacMini M1.

Symptoms: When trying to activate SCP, it spawns at least four copies of QGIS instantaneously, then hangs (Apple's Beach Ball spinning). Only way to shut it down is Force Quit all four processes.

When I run QGIS from the terminal and enable the plug in, I get a bunch of error messages (terminal dialogue file attached)

SCP Trace Log.rtf

Any thoughts on how to get around this problem?

Activity

  1. NR3Y commented on Jul 16, 2026

    @NR3Y
    Author

    More detailed information (after spending a couple of hours running suggestions from Anthropic)

    Title: macOS: activating SCP 8.5.0 on QGIS 3.44 spawns multiple full QGIS instances via multiprocessing spawn misconfiguration — persists even after correcting set_executable() path

    Environment: macOS Tahoe, Apple Silicon, QGIS 3.44, SCP 8.5.0

    Summary:
    Checking the "activate" checkbox for SCP in the QGIS Plugin Manager (no tool run required) immediately spawns 4–5 full QGIS.app instances. The original becomes unresponsive. Terminating a spawned instance causes another to immediately reappear; only force-quitting all instances stops it. Reproduces every time.

    Console output (./QGIS from Contents/MacOS):

    ERROR: Status 2: File /Applications/QGIS.app/Contents/MacOS/-c could not be found
    ERROR: Status 2: File /Applications/QGIS.app/Contents/MacOS/from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=18, pipe_handle=55) could not be found
    ERROR: Status 2: File /Applications/QGIS.app/Contents/MacOS/--multiprocessing-fork could not be found
    ERROR: Status 2: File /Applications/QGIS.app/Contents/MacOS/from multiprocessing.resource_tracker import main;main(17) could not be found
    

    Root cause (confirmed):
    sys.executable inside QGIS's embedded Python resolves to the QGIS launcher itself:

    >>> sys.exec_prefix
    '/Applications/QGIS.app/Contents/Frameworks/'
    >>> sys.executable
    '/Applications/QGIS.app/Contents/MacOS/QGIS'

    When multiprocessing.set_start_method('spawn') runs (unconditionally, at module import) without a working set_executable() redirect, each spawned worker re-invokes sys.executable — the QGIS launcher — with -c "..." / --multiprocessing-fork args. QGIS can't interpret these as files to open and opens a new blank window per attempt instead.

    Existing macOS path detection is outdated for this build:
    The darwin branch in semiautomaticclassificationplugin.py's __init__ tries:

    1. sys.exec_prefix/bin/python3
    2. sys.exec_prefix/../Resources/bin/python3

    Neither exists here. The real interpreter is at /Applications/QGIS.app/Contents/MacOS/python3.12, confirmed via find.

    I patched the darwin branch locally to add a third fallback (path.join(sys.exec_prefix, '../MacOS/python3.12')), confirmed to resolve correctly and point to an existing file. This did not resolve the issue — identical crash even with a correct, confirmed set_executable() path in place. This suggests either:

    • remotior_sensus.Session(...) (called later in __init__ with multiprocess_module=multiprocessing) resets/bypasses the executable configuration set earlier, or
    • the crash originates from a different multiprocessing entry point than the darwin branch.

    Request: Since patching the known darwin branch didn't fix it, could you point to where else multiprocessing's context/executable gets configured or reset? Happy to test further patches.

  2. semiautomaticgit commented on Jul 20, 2026

    @semiautomaticgit
    Owner

    Hello @NR3Y ,

    about your issue it is likely a QGIS installation issue, possibly related to other Python environments in the system.
    In general to solve these kind of issues, one should first clean the whole system (removing all the Python versions), then reinstall QGIS.
    Unfortunately I don't have experience in how to clean the environment with macOS. However, I suggest to install QGIS 4 because maybe it could configure a different Python environment.
    Also, I recommend installing the new SCP version 9 for QGIS 4.
    I'm moving this to discussions, because the SCP v. 8.5 is outdated.

  3. Repository owner locked and limited conversation to collaborators on Jul 20, 2026
  4. converted this issue into a discussion #448 on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions