崇高文本插件开发

2024-04-29 16:35:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我开发了一个命令行python应用程序,将带有语法高亮显示(pygments)的源文件保存为evernote注释;这个工作很好。 现在我想将这个应用程序集成到一个sublime text2插件中,但是我的应用程序需要一些python模块才能工作(比如evernotesdk、pygments库)。 项目结构如下:

Package
   |
   ---My_Plugin
          |
          -----evernote/
          |
          -----pygments/
          |
          myplugin_main.py

我正在尝试包括以下模块:

^{pr2}$

我在处理这个外部模块时遇到了很多问题;我不明白为什么应用程序看不到模块。在

在崇高控制台上,当我试图拯救时,我收到了这样的信息:

Reloading plugin /home/sergioska/.config/sublime-text-2/Packages/evernote-sublime-plugin/ever.py
Traceback (most recent call last):
File "./sublime_plugin.py", line 62, in reload_plugin
File "./ever.py", line 3, in <module>
    from evercode import EverCode
File "./evercode.py", line 7, in <module>
    from evernote.api.client import EvernoteClient
File "/home/sergioska/.config/sublime-text-2/Packages/evernote-sublime-plugin/evernote/evernote/api/client.py", line 5, in <module>
    import oauth2 as oauth
File "./oauth2/__init__.py", line 32, in <module>
    import httplib2
File "./httplib2/__init__.py", line 915, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

当然,我也尝试像上面所说的那样添加oauth2和httplib2,但是什么都没有。 我怎样才能解决这个问题?在


Tags: 模块inpyimport应用程序homepygmentsline