Sublime Forum

Using External Modules/Libraries In The Interpreter

#1

Hi, I’m wondering if it is at all possible to use external Python libraries in the interpreter. For example, I’m trying to essentially turn Sublime Text into a PostgreSQL client, where I can run queries and update functions using the Python interpreter. I want to be able to use the py-postgresql driver, but I’m not sure where to begin. Does anyone have an advice on whether or not this is possible?
Thanks.

0 Likes

#2

I’d love to hear a straight forward answer to this question. I’m using the linux release which comes packaged with its own version of the python interpreter. I can install/import into my existing python environment but no luck so far in doing this with Sublimes own version.

Please if anybody knows the answer to this!!

JLove

0 Likes

#3

same question here… Thanks!

0 Likes

#4

Of course you can use external Python library in ST2, lot of plugin already do that.

However you cannot use any kind of package management installation (easy_install) or setup.py to do that (or I don’t know how).
You must copy required files in a path accessible from ST2 internal Python interpreter, a sub folder in your own package folder is fine.

Probably not all Python module could work with ST2, especially if it’s not a pure Python module. And some part of the standard Python library is missing.

Now it’s probably not a good idea to put everything in your plugin.
Why not calling an external Python script when you have to do something heavy or requiring external dependency ?

0 Likes