Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IntelliJ IDEA插件-无法导入包com.jetbrains.python_Python_Intellij Idea_Intellij Plugin - Fatal编程技术网

IntelliJ IDEA插件-无法导入包com.jetbrains.python

IntelliJ IDEA插件-无法导入包com.jetbrains.python,python,intellij-idea,intellij-plugin,Python,Intellij Idea,Intellij Plugin,我正在为ItelliJ IDEA社区版2018.1.5编写一个插件。我设置了Executor类和GenericProgramRunner类 public class CheckerRunner extends GenericProgramRunner { @NotNull @Override public String getRunnerId() { return "CheckerRunner"; } @Override publ

我正在为ItelliJ IDEA社区版2018.1.5编写一个插件。我设置了Executor类和GenericProgramRunner类

public class CheckerRunner extends GenericProgramRunner {
    @NotNull
    @Override
    public String getRunnerId() {
        return "CheckerRunner";
    }

    @Override
    public boolean canRun(@NotNull String executorId, @NotNull RunProfile runProfile) {
        boolean result = executorId.equals(CheckerExecutor.EXECUTOR_ID) ;
        result = result && runProfile.getClass().toString().contains("PythonRunConfiguration");
        return result;
    }

    @Override
    protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {

        RunProfile profile = env.getRunProfile();
        if (profile != null) {
            System.out.println(profile.getClass().toString());
        }
        return null;
    }

}
我试图导入类
com.jetbrains.python.run.PythonRunConfiguration
以用于运行程序的
doExecute
方法,但它似乎找不到包
come.jetbrains.python
。表示无法解析符号“python”

这是我的跑步者课程的代码

public class CheckerRunner extends GenericProgramRunner {
    @NotNull
    @Override
    public String getRunnerId() {
        return "CheckerRunner";
    }

    @Override
    public boolean canRun(@NotNull String executorId, @NotNull RunProfile runProfile) {
        boolean result = executorId.equals(CheckerExecutor.EXECUTOR_ID) ;
        result = result && runProfile.getClass().toString().contains("PythonRunConfiguration");
        return result;
    }

    @Override
    protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {

        RunProfile profile = env.getRunProfile();
        if (profile != null) {
            System.out.println(profile.getClass().toString());
        }
        return null;
    }

}
canRun
方法中,条件
runProfile.getClass().toString()包含(“PythonRunConfiguration”)
的计算结果为true。
doExecute
方法打印
class com.jetbrains.python.run.PythonRunConfiguration

到控制台。为什么我不能导入该类?

您是否查阅了有关的文档?您需要在Python插件上添加依赖项。谢谢!成功了。