有没有人知道在ST3中安装插件SublimeClang是否有特殊方法?
在崇高的文本2中,曾经有一个" lib"我们用于python链接的sublime文件夹中的文件夹。
在我的例子中,我安装了python2.6,并创建了一个链接,我将其放入一个新创建的" lib"文件夹(/opt/sublime_text/lib
),但它不起作用。
知道它如何与ST3一起使用吗?
非常感谢你。
PS:这是我启动ST3时的输出。
reloading plugin SublimeClang.common
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 854, in _load_module
File "<frozen importlib._bootstrap>", line 981, in get_code
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/jean/.config/sublime-text-3/Packages/SublimeClang/common.py", line 135
print msg
^
SyntaxError: invalid syntax
reloading plugin SublimeClang.errormarkers
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 869, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/jean/.config/sublime-text-3/Packages/SublimeClang/errormarkers.py", line 4, in <module>
from common import get_setting
ImportError: No module named 'common'
reloading plugin SublimeClang.staticanalyzer
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 869, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/jean/.config/sublime-text-3/Packages/SublimeClang/staticanalyzer.py", line 31, in <module>
import Queue
ImportError: No module named 'Queue'
reloading plugin SublimeClang.sublimeclang
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 854, in _load_module
File "<frozen importlib._bootstrap>", line 981, in get_code
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/jean/.config/sublime-text-3/Packages/SublimeClang/sublimeclang.py", line 415
print "found fast completions"
^
SyntaxError: invalid syntax
reloading plugin SublimeClang.translationunitcache
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1023, in load_module
File "<frozen importlib._bootstrap>", line 1004, in load_module
File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 854, in _load_module
File "<frozen importlib._bootstrap>", line 981, in get_code
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/jean/.config/sublime-text-3/Packages/SublimeClang/translationunitcache.py", line 103
print "Have SublimeClang package: %s" % json
^
SyntaxError: invalid syntax
答案 0 :(得分:1)
从您的链接看,该插件似乎不再被积极开发,并且README中没有提及ST3。错误消息暗示a)模块正在尝试加载其他不存在或已移动的模块,以及b)插件是用Python 2编写的(ST2使用Python 2.6),而ST3基于Python 3.3。作为一个非常简单的示例,Python 2中的语句print "Hello World!"
已替换为Py3中的函数print("Hello World!")
。至于缺少的模块错误,ST3的组织方式与ST2不同,除了最简单的插件外,几乎所有插件都需要移植到新的API中。
答案 1 :(得分:1)
我通过更改python文件中的导入来解决问题。