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?

0

^ 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?

0

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.

1

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.

0

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?

1

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:

 

2023-04-21 14:04:11,990 [    264] SEVERE - #c.i.i.p.PluginManager - Problems found loading plugins:
  Module com.intellij.modules.python is declared by multiple plugins:
  PluginDescriptor(name=Python, id=Pythonid, descriptorPath=plugin.xml, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python, version=221.6008.17, package=null, isBundled=false)
  PluginDescriptor(name=Python Community Edition, id=PythonCore, descriptorPath=plugin.xml, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python-ce, version=221.6008.17, package=null, isBundled=false)
  The Python (id=Pythonid, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python, version=221.6008.17) plugin Plugin 'Python' requires plugin 'com.intellij.modules.ultimate' to be installed
java.lang.Throwable: Problems found loading plugins:
  Module com.intellij.modules.python is declared by multiple plugins:
  PluginDescriptor(name=Python, id=Pythonid, descriptorPath=plugin.xml, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python, version=221.6008.17, package=null, isBundled=false)
  PluginDescriptor(name=Python Community Edition, id=PythonCore, descriptorPath=plugin.xml, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python-ce, version=221.6008.17, package=null, isBundled=false)
  The Python (id=Pythonid, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\python, version=221.6008.17) plugin Plugin 'Python' requires plugin 'com.intellij.modules.ultimate' to be installed
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.intellij.ide.plugins.PluginManagerCore.preparePluginErrors(PluginManagerCore.java:543)
    at com.intellij.ide.plugins.PluginManagerCore.initializePlugins(PluginManagerCore.java:854)
    at com.intellij.ide.plugins.PluginManagerCore.loadAndInitializePlugins(PluginManagerCore.java:987)
    at com.intellij.ide.plugins.PluginManagerCore.lambda$getOrScheduleLoading$5(PluginManagerCore.java:622)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
2023-04-21 14:04:11,995 [    269] SEVERE - #c.i.i.p.PluginManager - IntelliJ IDEA 2022.1.4  Build #IC-221.6008.13
2023-04-21 14:04:11,998 [    272] SEVERE - #c.i.i.p.PluginManager - JDK: 11.0.15; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2023-04-21 14:04:11,998 [    272] SEVERE - #c.i.i.p.PluginManager - OS: Windows 10
2023-04-21 14:04:12,712 [    986]   WARN - #c.i.n.i.NotificationGroupManagerImpl - Notification group CodeWithMe is already registered (group=com.intellij.notification.NotificationGroup@62c6761). Plugin descriptor: PluginDescriptor(name=Code With Me, id=com.jetbrains.codeWithMe, descriptorPath=plugin.xml, path=~\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2022.1.4\e3ffd300c9b86b78a24cd23fdc358ac8493afdf5\ideaIC-2022.1.4\plugins\cwm-plugin, version=221.6008.13, package=null, isBundled=true)

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

 

java.lang.NoClassDefFoundError: com/jetbrains/python/psi/PyFile
    at com.cjcrafter.gptbrains.docs.GeneratePythonDocs.actionPerformed(GeneratePythonDocs.kt:28)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:235)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:256)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:235)
    at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:240)
    at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:249)
    at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:245)
    at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$1(ActionPopupStep.java:220)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1538)
    at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101)
    at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:179)
    at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:132)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:172)
    at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1535)
    at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:162)
    at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:272)
    at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:139)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:169)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:219)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:207)
    at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:266)
    at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:434)
    at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:406)
    at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:361)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:289)
    at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:618)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:694)
    at java.desktop/java.awt.Component.processEvent(Component.java:6419)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2793)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:119)
    at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.ClassNotFoundException: com.jetbrains.python.psi.PyFile PluginClassLoader(plugin=PluginDescriptor(name=GPTBrains, id=com.cjcrafter.GPTBrains, descriptorPath=plugin.xml, path=~\Desktop\Code\GPTBrains\build\idea-sandbox\plugins\GPTBrains, version=0.2.0-BETA, package=null, isBundled=false), packagePrefix=null, instanceId=79, state=active)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:215)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 72 more
0

I think I solved my own issue...

// 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("IU") // IU has more built-in plugins, for example, JavaScript

plugins.set(listOf(
"java",
"markdown",
"Pythonid:221.6008.17",
"JavaScript"
))
}

How I understand it:

  1. Always update the build.gradle.kts BEFORE changing your plugin.xml files
  2. Without the plugins above^, I wasn't able to access com.intellij.modules.python
  3. I was trying to use python-capable. I do not know the difference.
  4. Switching to IU may have had side effects, more testing is required.
0

请先登录再写评论。