Cannot find builtin plugin 'Pythonid' for IDE
已回答
Hello, I am trying to make a tool that supports Java and Python for code generation (I plan on supporting many languages, but I am currently struggling with Python). I am also trying to support all JetBrains editors (Community and Ultimate). Here is the error I am getting:
FAILURE: Build failed with an exception.
* What went wrong:
Cannot find builtin plugin 'Pythonid' for IDE: C:\Users\colli\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIU\2022.1.4\98b3e216a2b82505ebb156eef3a4f6de71d0f6ce\ideaIU-2022.1.4
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.7.20"
id("org.jetbrains.intellij") version "1.13.3"
}
group = "com.cjcrafter"
version = "0.2.0-BETA"
repositories {
mavenCentral()
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.9.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.cjcrafter:openai:1.3.0")
}
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2022.1.4")
type.set("IC")
plugins.set(listOf("java", "markdown", "Pythonid"))
}
tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
patchPluginXml {
sinceBuild.set("221")
untilBuild.set("231.*")
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.7.20"
id("org.jetbrains.intellij") version "1.13.3"
}
group = "com.cjcrafter"
version = "0.2.0-BETA"
repositories {
mavenCentral()
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.9.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.cjcrafter:openai:1.3.0")
}
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2022.1.4")
type.set("IC")
plugins.set(listOf("java", "markdown", "Pythonid"))
}
tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
patchPluginXml {
sinceBuild.set("221")
untilBuild.set("231.*")
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}
<idea-plugin>
<id>com.cjcrafter.GPTBrains</id>
<name>GPTBrains</name>
<vendor>snip</vendor>
<description>snip</description>
<depends>com.intellij.modules.platform</depends>
<depends>org.intellij.plugins.markdown</depends>
<depends optional="true" config-file="java-brains.xml">com.intellij.modules.java-capable</depends>
<depends optional="true" config-file="python-brains.xml">com.intellij.modules.python-core-capable</depends>
</idea-plugin>
My best guess is that this is a part of the problem:
type.set("IC")
Since IC doesn't support python?
请先登录再写评论。
^ Accidently posted build.gradle.kts twice.
As a followup question, how can I add multiple run plugin tasks? Like runIC (intellij community), runPC(pycharm community), etc?
Hi, Collin!
Python plugin isn't bundled in the IU, so you have to pass its version that matches 2022.1.4 — which reflects build number 221.6008.13.
To do so, check available versions on the Python plugin page: https://plugins.jetbrains.com/plugin/631-python/versions/stable/198633
That'd be: Pythonid:221.6008.17
As for the second question — such a configuration is tricky because you have to distinguish between IU + Python plugin and the PC that relies on the Python Community plugin — PythonCore, which is bundled in it.
To achieve that, you could introduce a multi-module setup with a core module based on IC with no fancy plugins set, and a set of modules dedicated to each of your cases, that'll also depend on the core module. Each module, like fooIU, barPC should utilize core with:
dependencies {implementation(project(":core", "instrumentedJar"))
}
With this approach, you can run :fooIU:runIde or :barPC:runIde.
Jakub Chrzanowski
Many thanks for the quickest reply!!! But if somebody adds a corresponding example into intellij-sdk-code-samples it would be awesome! Personally, I am interested in developing custom Python inspection but running it in IntelliJ Idea. (for me no different UIs are needed) These code samples already contains product_specific/pycharm_basics but that project sample runs PyCharm.
I have added Pythonid as plugin but now I have error:
`Caused by: java.lang.ClassNotFoundException: com.jetbrains.python.inspections.PyInspection`
I am trying to create python inspection.
Could somebody please help me with this error?
Having a similar issue. I am suspicious that the issue is due to using the Python plugin instead of the built in support in pycharm.
When I building the plugin, I get a few python related errors:
I am trying to support java + python, have separate features for both those languages. It shouldn't matter if people are in intellij community or ultimate, or pycharm community or ultimate. I hope there is a way to natively support this.
Also when trying to run intellij with the python plugin installed, the plugin "activated" but not really. I ended up with a classdefnotfound despite python being installed
I think I solved my own issue...
How I understand it: