Import errors in a plugin project's Python files

I created a plugin project following the instructions here:

https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/creating_plugin_project.html 

I want to include some Python scripts in my project, and I'd like to be able to edit them as part of the project, but they always show a bunch of import errors. For example, I wrote this simple script:

import sys

print(sys.version)

On the first line, I get the error, "No module named sys."

If I switch the module SDK to a Python SDK, then the error goes away, but I can't run the plugin anymore. The plugin run configuration has the error, "Wrong SDK type for plugin module."

Do I have to keep switching the SDK back and forth, or can I configure it somehow to let me edit Python scripts inside a plugin module?

I'm running IntelliJ IDEA 2019.1.3 with the Python plugin v2019.1.191.7479.19.

0

请先登录再写评论。