Home Download Buy Blog Forum Support

Selecting version of Python

Selecting version of Python

Postby exclipy on Fri Jan 27, 2012 11:31 pm

I'm trying to make a plugin that uses Berkeley DB through the bsddb bindings and I'm getting this error:

Code: Select all
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/bsddb/__init__.py", line 64, in <module>
    import _bsddb
ImportError: No module named _bsddb


After Googling around, it's apparently due to a problem with the default installed Python on Mac OS. So I installed a Python from MacPorts which fixes this issue, but I can't get Sublime to use it. Is it possible to make it use a different Python framework?
exclipy
 
Posts: 5
Joined: Fri Jan 27, 2012 11:26 pm

Re: Selecting version of Python

Postby exclipy on Sat Jan 28, 2012 11:57 am

Or alternatively, how do I install a Python module such that Sublime will find it? I tried LevelDB as an alternative to BerkeleyDB, and its source package comes with a setup.py, but when I ran "python setup.py install", it put it in a location accessible to the "python" interpreter, but not to the Sublime console.
exclipy
 
Posts: 5
Joined: Fri Jan 27, 2012 11:26 pm

Re: Selecting version of Python

Postby quarnster on Sat Jan 28, 2012 12:12 pm

Why not use sqlite3? That seems to be importable just fine in the Sublime Text 2 console.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Selecting version of Python

Postby exclipy on Sat Jan 28, 2012 1:01 pm

I'd prefer to have the performance of a pure key-value store, and to not have to build strings of SQL queries.
exclipy
 
Posts: 5
Joined: Fri Jan 27, 2012 11:26 pm

Re: Selecting version of Python

Postby kevinmullin on Tue Jan 31, 2012 8:43 pm

Ive added a few lines to my Python.sublime-build file for this same reason. Its pretty straight forward.

PATH_TO_INSTALL\Sublime Text 2 Build 2165 x64\Data\Packages\Python\Python.sublime-build

Here is my Python.sublime-build file below. I just uncomment/comment the versions as I need them.

{
// LOCAL
//"cmd": ["c:/python25/python.exe", "-u", "$file"],
//"cmd": ["c:/python26/python.exe", "-u", "$file"],
//"cmd": ["c:/python27/python.exe", "-u", "$file"],
//"cmd": ["c:/python32/python.exe", "-u", "$file"],
// PORTABLE
//"cmd": ["G:/app/python2.6.1/App/python.exe", "-u", "$file"],
//"cmd": ["G:/app/python2.7.2.1/App/python.exe", "-u", "$file"],
//"cmd": ["G:/app/python3.2.1.1/App/python.exe", "-u", "$file"],
// CUSTOM PORTABLE
//"cmd": ["G:/app/python26/python.exe", "-u", "$file"],
"cmd": ["G:/app/python27/python.exe", "-u", "$file"],

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
kevinmullin
 
Posts: 1
Joined: Tue Jan 31, 2012 8:37 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 7 guests