How to use classes of pythonPlugin? always compile failed, say can't find package
Answered
I create a gradle plugin project, by the document way(https://plugins.jetbrains.com/docs/intellij/gradle-guide.html)。Then I add the python's depend:
<depends>com.intellij.modules.python</depends>
But it report an error:
Cannot resolve plugin 'com.intellij.modules.python' in dependencies (Reference: Plugin Dependencies)
I find a way to resolve it: https://intellij-support.jetbrains.com/hc/en-us/community/posts/4416336449554-The-lack-of-python-jar-python-ce-jar-in-IntelliJ-Platform-Plugin-SDK-cause-a-error-of-resovle-plugin-depends-com-intellij-modules-python-
But when I build the project (use intellj.buildPlugin), it reported an error:
错误: 程序包com.jetbrains.python.psi不存在 (Error: Package com.jetbrains.python.psi does not exist)
import com.jetbrains.python.psi.PyFunction;
^
How can I fix the error ? I want to use the Python PSI in my Plugin.
Thanks for your answer !
Please sign in to leave a comment.
You must set/add Python dependencies as described here first: https://plugins.jetbrains.com/docs/intellij/pycharm.html
Hi Yann Cebron,
Thanks for your help. I have followed the steps to set it up, but still fail. This is my "build.gradle" and "plugin.xml":
Is there anything wrong?
build.gradle
plugin.xml
I find that add the dependency to the "PythonCore" can resovle it:
https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html#3-dependency-declaration-in-pluginxml
Dose this complict with the description "No specific declaration is needed to use
PY
orPC
APIs." ?