API Environments
Version:

Plugins in Sublime Text are Python files located in the root of a package. The following document describes the Python environment the plugins are run in.

OverviewπŸ”—

Sublime Text runs plugins in a separate process from the main editor UI. This process runs an executable named plugin_host.

Running plugins in a separate process ensures the entire editor will not crash due to a poorly written plugin. If a plugin does cause the plugin_host to crash, a user may still save their work before re-starting Sublime Text.

All plugins are run in a single plugin_host process, and share a single Python environment. Each plugin is loaded as a sub-module of a module named after the package. For example, a plugin in the file MyPackage/my_plugin.py will be loaded as the Python module MyPackage.my_plugin.

The plugin_host process contains an embedded version of the Python programming language, and exposes an API to plugins. The plugin_host executable always uses its own embedded version of Python, even if the end-user has Python installed on their machine.

Python VersionπŸ”—

By default all plugins are run using Python 3.3.6, except inside the User package which always uses the latest python. Sublime Textβ€˜s build of Python 3.3.6 includes a handful of patches backported from Python 3.4 to fix issues with unicode paths and crashes with the ctypes module on 64bit versions of Windows.

Starting in build 4050, plugins may also be run using Python 3.8. Python 3.8 features many improvements to the language, better performance and continued support and bug fixes from the Python Software Foundtion.

<next

Since build 4050 plugins may also be run using Python 3.8. Starting in build 4205 this has been replaced with Python 3.14.

4205

Python 3.3 is deprecated and will be removed in 2026. See our announcement here.

4205

Selecting the Python VersionπŸ”—

Any package that wishes to use Python 3.8 must create a file named .python-version in the root of the packages. This file should contain either the text 3.3 or 3.8 to select the version of Python to use. If a file named .python-version is not present, or it contains any value other than 3.8, then Python 3.3 will be used.

<4205

All plugins in a package will use the same version of Python. Any package with a .python-version file containing 3.8 loaded in older builds of Sublime Text will try to run the plugins using Python 3.3.

<4205

Any package that wishes to use Python 3.14 must create a file named .python-version in the root of the package. This file should contain either 3.3 or 3.14 to select the desired Python version. For backwards compatibility you can also use 3.8 to select Python 3.14. If a file named .python-version is not present, or contains any unknown value, then Python 3.3 will be used.

The Python 3.3 plugin host can be fully disabled using the setting "disable_plugin_host_3.3": false. This will make all plugins run under the newer plugin host.

4193

ModulesπŸ”—

The Python environment within plugin_host contains all of the modules in The Python Standard Library, except for:

  • audioop

  • crypt (Not on Linux)

  • curses

  • cProfile (Not on Linux) <4050

  • fpectl 4050 3.3

  • readline

  • lzma 4050 3.3

  • msilib

  • nis

  • ossaudiodev

  • resource 4050 3.3

  • spwd

  • syslog

  • test

  • tkinter

  • turtle

  • wave

Python 3.14 ModulesπŸ”—

Python 3.14 removed a number of modules we didn’t ship previously. The Python 3.14 environment contains all of the modules in The Python Standard Library, except for:

  • curses

  • readline

  • test

  • tkinter

  • turtle

4205

Pre-Installed PackagesπŸ”—

The following the packages are pre-installed in both the Python 3.3 and 3.8 environments:

  • certifi: A collection of SSL root certs for use with urllib

4050