I am not able to load the Crypto library in ST2 (Mac OS X). I know that "Sublime Text ships with a trimmed down standard library. Notable missing modules are the Tkinter, multiprocessing and sqlite3 modules. trimmed down standard library. Notable missing modules are the Tkinter, multiprocessing and sqlite3 modules." (http://docs.sublimetext.info/en/latest/ ... ugins.html)

But this list does not include Crypto and my understanding is that ST2 on Mac OX is using system python (I can, for example, import sqlite3).

Any ideas?

Thanks!

ps: I actually want to use paramiko, which relies on Crypto.

Last edited by gregor.hoch on Tue Nov 27, 2012 8:01 pm, edited 4 times in total.

Yes, of course, you are right! So what I did is get the files from the paramiko library, copy them to the folder [ST Packages]/[MY PACKAGE]/paramiko with the __init__ in it and I should be able to load the library, right? I am still failing with the Crypto library. It's actually in a subfolder of the paramiko library so I copy it from this subfolder to [ST Packages]/[MY PACKAGE]/Crypto, which solves one problem but others come up. The one I am currently stuck with is this:File "./Crypto/Util/Counter.py", line 59, in <module>from Crypto.Util import _counter

Any ideas?

EDIT: Actually, I downloaded crypto separately and placed it in the [ST Packages]/[MY PACKAGE]/Crypto folder. Here are the two links:http://www.lag.net/paramiko/download/pa ... .7.7.1.ziphttps://www.dlitz.net/software/pycrypto/Then I get the error File "./Crypto/Random/__init__.py", line 28, in <module> from Crypto.Random import OSRNGwhich is solved by changing line 28 in the Crypto/Random/__init__.py file from 'from Crypto.Random import OSRNG' to 'import OSRNG' Now I arrive at the error File "./Crypto/Util/Counter.py", line 59, in <module> import _counter

Any solutions? Am I doing something wrong when I try to 'install' a library for ST2 python?

okay, I solved my problem. Here are the steps just in case anyone else wants to use the 'paramiko' library for a ST2 plugin:

1) use 'easy_install paramiko' to install paramiko and crypto. Now your system python should be able to import paramiko2) Install paramiko for your ST2 plugina) Get paramiko from here http://www.lag.net/paramiko/ (or alternatively the most recent version from github). b) Place the folder with the '__init__.py' file in [ST Packages]/[MY PACKAGE]/paramiko3) Install Crypto for your ST2 plugina) Check where your python libraries are using python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"b) Go to that folder (in my case /Library/Python/2.7/site-packages) and copy the file 'pycrypto-2.6-py2.7-macosx-10.8-intel.egg' somewherec) Unpack it (just rename it to .zip)d) copy the Crypto folder with the __init__ file from the unpacked folder to [ST Packages]/[MY PACKAGE]/Crypto4) Change line 28 in the file '../Crypto/Random/__init__.py' from 'Crypto.Random import OSRNG' to 'import OSRNG'(Note: I think you have to go through the installed Crypto package and not just the downloaded one because that includes some compiled c libraries. So I guess you can also compile them yourself)

I know, it's a mess but now you should be ready to go. If anyone has an easier solution, please post. I think that these kind of things prevent a lot of non-professional developers from developing packages.