-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Problem description
Python packages such as pywin32 ship with <name>.pth files to register custom sub directories to sys.path to enable contained modules to be imported.
Such files are evaluated for site-packages directories, only.
ST does not seem to treat $data/Lib/python<version> directories as site-packages even though those are intended to be target for installing 3rd-party python packages (via Package Control or PIP).
As a result, *.pth files are not evaluated and packages relying on them don't work as expected.
see: https://docs.python.org/2/library/site.html
Note: $data is a synonym for ST's data directory (e.g.: ~/.config/sublime-text).
Preferred solution
Configure python interpreter to use $data/Lib/python<version> as site-package, so it evaluates .pth files, when starting.
Alternatives
Some kind of loader module (or once again a 0_package_control.sublime-package per python-version) was needed to register the paths.
A plugin with following content makes plugin_hosts load .pth files and fixes packages such as pywin32.
import site
site.addsitedir("$data/Lib/python38")Additional Information
No response