Info |
---|
This article helps troubleshoot the "DLL load failed while importing" error while attempting to register the agent. |
Status |
---|
colour | Green |
---|
title | LAST TESTED ON CHECKMK 2.0.0P1 |
---|
|
Since Checkmk 2.0, we do provide Python inside the Checkmk Agent (Werk # 10689). If you're using PYTHONHOME or PYTHONPATH, you may run into a similar issue:
Code Block |
---|
|
C:\Windows\system32>"C:\Program Files (x86)\checkmk\service\check_mk_agent.exe" updater register -v
Traceback (most recent call last):
File "C:\ProgramData\checkmk\agent\plugins\cmk_update_agent.checkmk.py", line 18, in <module>
import logging.handlers
File "C:\Program Files\Python38\Lib\logging\handlers.py", line 26, in <module>
import logging, socket, os, pickle, struct, time, re
File "C:\Program Files\Python38\Lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed while importing _socket: %1 is not a valid Win32 application. |
Step-by-step guide
Verify if PYTHONHOME and PYTHONPATH are really set.
Code Block |
---|
|
C:\ProgramData\checkmk\agent\plugins>set | findstr /c:"PYTHON"
PYTHONHOME="C:\Program Files\Python38"
PYTHONPATH="C:\Program Files\Python38\Lib" |
Remove that from the settings:
Code Block |
---|
|
C:\Program Files (x86)\checkmk\service>set PYTHONHOME=
C:\Program Files (x86)\checkmk\service>set PYTHONPATH= |
Try again to run the Checkmk updater
Code Block |
---|
|
C:\Program Files (x86)\checkmk\service>check_mk_agent.exe updater register
Using previous settings from C:\ProgramData\checkmk\agent\config\cmk-update-agent.state.
Our host name in the monitoring: |
.
Some background information:
Conclusion
You're able to run multiple Python Versions on one Windows machine. For that, we see two approaches at the moment.
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | KB |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label in ("windows","windows_agent","python") and type = "page" and space = "KB" |
---|
labels | security |
---|
|