I installed recordclass
via pip3 install recordclass
which installs it under /Users/timothee/homebrew/lib/python3.7/site-packages/recordclass
; I'm trying to use it from a sublimetext package but it fails:
import sys
sys.path.append('/Users/timothee/homebrew/lib/python3.7/site-packages')
import recordclass
ImportError: No module named 'recordclass.mutabletuple'
If I instead use sys.path.append('/Users/timothee/homebrew/lib/python3.7/site-packages/recordclass')
I get: SystemError: Parent module '' not loaded, cannot perform relative import
Note that it does work for some other pip3 installed modules, eg jstyleson
, simplejson
.
Here is contents of recordclass:
\ls
__init__.py arrayclass.py datatype.py mutabletuple.cpython-37m-darwin.so recordobject.cpython-37m-darwin.so test utils.py
__pycache__ dataobject.cpython-37m-darwin.so litelist.cpython-37m-darwin.so recordclass.py structclass.py typing
Not sure whether the reason is that sublime bundles its own python interpreter (3.3 IIRC) and my system python is 3.7, and it installs as recordobject.cpython-37m-darwin.so
so can't be seen by sublime's python; but temporarily renaming to recordobject.cpython-33m-darwin.so
didn't help.
Note: I've read other similar questions but these didn't help, eg: * Install python module without PIP => not relevant; I can install it; just not load it from sublime * Installing python modules like "Web3" without pip/pip3? ditto * https://github.com/SublimeText/UnitTesting/issues/67
This is the most relevant post: Sublime Plugin: How can I import wx? but the solution there doesn't seem to work; since the problem seems to be these darwin.so
files in my case