Skip to content

Run Package Control settings helper in isolated mode - #308

Open
rchl wants to merge 1 commit into
SublimeText:masterfrom
rchl:fix/pc-packages-isolated-python
Open

rchl wants to merge 1 commit into
SublimeText:masterfrom
rchl:fix/pc-packages-isolated-python

Conversation

@rchl

@rchl rchl commented Oct 25, 2026

Copy link
Copy Markdown
Member

install_package_control.sh adds the packages listed by name in extra-packages to Package Control's settings with python3 -B -. A script read from stdin gets the current directory at the start of sys.path, and that directory is usually the package checkout. So a module in the package's root that has the name of a standard library module gets imported instead of it.

In sublimelsp/LSP-elm, types.py breaks import json on macOS (Homebrew Python 3.15), since enum imports types:

  File "/Users/runner/work/LSP-elm/LSP-elm/types.py", line 3, in <module>
    from LSP.protocol import DocumentUri
ModuleNotFoundError: No module named 'LSP'

https://github.com/sublimelsp/LSP-elm/actions/runs/40231054004/job/121282672827

Ubuntu and Windows pass, probably because their Python has already imported types at startup.

-I (isolated mode) leaves the current directory and user site-packages off sys.path and ignores PYTHON* environment variables. The helper only needs the standard library. The PowerShell script doesn't run Python here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant