How to get python class references working in PyCharm plugin?
Hello,
I modified the IntelliBot plugin using IDEA community edition (did only minor changes). The plugin builds successfully and works as expected when running it in IDEA community edition.
I built the plugin via 'Prepare Plugin Module .. For Deployment' and installed it into PyCharm using the created zip file.
After restart I get the following error in Event Log:
NoClassDefFoundError: Could not initialize class com.jetbrains.python.psi.stubs.PyClassNameIndex
Dependencies in plugin.xml are the original ones:
<depends>com.intellij.modules.lang</depends>
<depends optional="true">com.intellij.modules.python</depends>
<depends optional="true">Pythonid</depends>
<depends optional="true">PythonCore</depends>
What should I do to get the plugin working in PyCharm?
Thanks,
Zoltan
Please sign in to leave a comment.
Looks like you added the Python plugin classes as a library to your module. Instead, you need to add them to the classpath of your IntelliJ IDEA SDK.
Thanks, this was the case.
How do I add those things to my IntelliJ IDEA SDK? Where are they?
@... see https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html#devkit
Yann Cebron Can you please explain this in terms used in the documentation? classpath is not mentioned on the documentation link you provided.
Finding information on how to get a plugin working with Python is quite frustrating as especially this step is not documented clearly anywhere. (if it is, it is very hard to find)
Benjamin Justice Above link mentions on how to setup the recommended way of using Gradle as project setup. Please see https://plugins.jetbrains.com/docs/intellij/pycharm.html for information on how to get started writing plugins for PyCharm.
If you have functionality specific to PyCharm Professional, see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html