Sublime Text Plugin : Adding python libraries

孤街醉人 提交于 2019-12-01 07:17:06

In order to use a third-party library in Sublime, you'll need to include it in your plugin directory, and you'll need to include the correct version for the Python you're working with - 2.6 for ST2, 3.3 for ST3. In order for the next step to succeed properly, install the version of Python you're targeting on your system from python.org. For example, if you're working with ST3, make sure you install Python 3.3.2 on your system.

Then, download the correct version of pywin32 from Christoph Gohlke's Python Extension Packages for Windows repository. Install it on your system, then try copying c:\Python33\Lib\site-packages\win32\ to your Packages/MyPlugin folder in Sublime. The installer makes several directories in site-packages, so depending on the system calls you're planning on making you might need to copy other directories as well - win32com, win32comext, pywin32_system32, and/or pythonwin.

You should now be able to import win32 or import .win32 in your plugin. Good luck!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!