Skip to content

[FAQ] Error when trying to create and use a plugin: Need some clarifications please #432

Closed
@soubinan

Description

@soubinan

The issue encountered

Hello, I was not sure if this one should go to the BUG category or no.
Could someone confirm the procedure to create and use a plugin, please ? For python (for golang if python is not possible).
I checked the doc (from v0.4 to v0.9) but it seems something is missing...

I followed both the golang and the python examples, but none of them worked for me, and always receiving the same error message as shared below:

Error: error[E2F04]: CannotFindModule
 --> /test.k:1:1
  |
1 | import kcl_plugin.my_plugin
  | ^ the plugin package `kcl_plugin.my_plugin` is not found, please confirm if plugin mode is enabled
  |

In some document version we are supposed to use kcl_plugin (but not explained how to install it)
In some other I found it is an alias of the kclvm.tools.plugin python package
In some (the more recent), there is no mention of these steps
None of all versions I checked is mentioning what is the plugin mode and how to enable it (but it is mentioned it was disabled by default for python, then not sure if it has been re-enabled or no)

But all share the same thing, none of those procedures works for me.
It is a bit confusing and lead me to many questions:

  • how to create a plugin ? (it is mentioned is old versions, no longer in newer, so not sure what to do)
  • where to store it so kcl will be able to see it ?
  • how to enable the plugin mode ?
  • how to use a plugin in a kcl file ? (it is mentioned, but since it is not working for me, a clarification/confirmation of to do would be great)

Additional info

I am currently using the latest kcl version:

$ kclvm_cli version
Version: 0.9.2-c020ab3eb4b9179219d6837a57f5d323
Platform: x86_64-unknown-linux-gnu
GitCommit: VERGEN_IDEMPOTENT_OUTPUT

$ kcl version
0.9.4-linux-amd64

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions