Home Download Buy Blog Forum Support

Cant import python pexpect

Cant import python pexpect

Postby theadamlt on Mon Apr 30, 2012 8:42 am


im trying to write a plugin where i need the pexpect module.

I am able to import pexpect in python scripts outside sublime text, but in the plugin code i get:

Code: Select all
Traceback (most recent call last):
  File "/usr/lib/sublime-text-2/sublime_plugin.py", line 62, in reload_plugin
    m = imp.load_module(modulename, *m_info)
  File "./grunt.py", line 1, in <module>
    import pexpect
ImportError: No module named pexpect

Does anyone have a solution?
Posts: 5
Joined: Thu Dec 22, 2011 1:39 pm

Re: Cant import python pexpect

Postby bizoo on Mon Apr 30, 2012 9:30 am

At least on Windows ST2 use it's own Python interpreter so you have to put pexpect module in a path where ST2 could find it. Your plugin package directory or user directory is fine.
I think it's the same for linux. For OSX I think it's the system Python interpreter that is used. But maybe I'm wrong here.
Posts: 958
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests