-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module not usable 'NameError: name 'MonitorType' is not defined' #50
Comments
I ran into the same issue, and I don't seem to be able to work around it. The issue is caused by the fact that the module is needed in the type annotation here. This works fine when the module can be imported, but if not, the global variable that signals the import error to the remaining code is not interpreted within time. I suggest to just have the import fail. For the record, I'm using ansible with pipx. I injected the dependency library and I can import it in the Python interpreter within the virtualenv created by pipx. |
Are you able to tell me which module you injected via pipx?
Unterwegs gesendet
Am 22.06.2024 um 02:13 schrieb TheAssassin - notifications at github.com ***@***.***>:
I ran into the same issue, and I don't seem to be able to work around it.
The issue is caused by the fact that the module is needed in the type annotation here. This works fine when the module can be imported, but if not, the global variable that signals the import error to the remaining code is not interpreted within time. I suggest to just have the import fail.
For the record, I'm using ansible with pipx. I injected the dependency library and I can import it in the Python interpreter within the virtualenv created by pipx.
—
Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APH6BQH5AJHIYX2GOWTWAHTZIS6RVAVCNFSM6AAAAABJIAGNB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTGYYDAMRYGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
It's the equivalent of running pip in there to install the module mentioned in the README. However, it does not solve the problem. |
I debugged the problem further. The issue is linked to how ansible runs modules on remote hosts. And yes, now it seems quite a bit more obvious to me than it used to. Please see https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#ansiballz-framework. When ansible executes a module from any collection, the module needs to be transferred to the remote host. Including the library in the local interpreter doesn't make any difference. It'd need to be bundled with this collection's code to be available to the target system. Executing a playbook with At any rate, you likely want to execute these modules locally even when using an inventory anyway, so setting Edit: the instructions in the README are at least incomplete and definitely misleading. |
What seems to work is to use |
Same issue. delegate_to didn't work for me |
After installing uptime-kuma-api as root it did work |
Hey there,
I'm not able to use the Modules :( Following is the Error:
The text was updated successfully, but these errors were encountered: