- GCode and Part Programs
- G&M Codes
- Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
- Abdelrahmankandil
-
Topic Author
- Away
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
26 Jun 2025 18:46 - 26 Jun 2025 18:47 #330903
by Abdelrahmankandil
Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized was created by Abdelrahmankandil
Hello everyone,I’m facing a persistent issue with implementing a Python-based M6 remap in LinuxCNC 2.9.4 running on Debian Bookworm. No matter what I try, LinuxCNC always reports that my remap function is “not a Python callable function,” even though I have followed all the official documentation and community advice.Details:
- Configuration:
- In my INI file, I have:
- [RS274NGC]
PARAMETER_FILE = linuxcnc.var
RS274NGC_STARTUP_CODE = G21 G40 G90 G94 G97 G64 P0.025
REMAP = M6 python=my_m6_remap_function modalgroup=6
[PYTHON]
PATH_PREPEND=/path/to/my/python/scripts
PATH_APPEND=/path/to/my/python/scripts
TOPLEVEL=/path/to/my/python/script/m6_tool_change.py
The Python file is in the correct directory, and the function name matches exactly. The function signature is:- def my_m6_remap_function(self, **words):
# minimal test code
print("Hello from REMAP")
return INTERP_OK
I have tried different function names, ensured the function is top-level (not inside a class or another function), and removed any __init__.py, .pyc, or __pycache__ files.File encoding is correct (UTF-8/ASCII), and permissions are set properly.Result:I always get the following error:
'my_m6_remap_function' is not a Python callable function - ...:REMAP = M6 python=my_m6_remap_function modalgroup=6
I have tested this on multiple machines, with fresh configs (including a clean Axis config), and even on a different PC – always the same result.Remapping using ngc (subroutine) works perfectly.
I can import linuxcnc in Python 3 without issues.
I have tried examples from stdglue.py and the forums – same error.Environment:Debian BookwormLinuxCNC 2.9.4 (from official repositories)Python 3 bindings are present and workingNotes:I suspect this is either a bug in LinuxCNC 2.9.4 on Bookworm or a missing package/feature in the current build.
Downgrading to an older distro or using Python 2 is not a practical option for me.I need Python remap for integration with a custom PyQt5 GUI and an Automatic Tool Changer (ATC).Has anyone else encountered this issue or found a practical solution?Is there a way to enable Python remap support in this environment, or any workaround besides using ngc?
Any help or suggestions would be greatly appreciated!
- def my_m6_remap_function(self, **words):
Last edit: 26 Jun 2025 18:47 by Abdelrahmankandil.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4425
- Thank you received: 1973
26 Jun 2025 19:03 #330904
by Aciera
Replied by Aciera on topic Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
Difficult to troubleshoot. Please attach your zipped config folder so we can see how things are setup.
Please Log in or Create an account to join the conversation.
- Abdelrahmankandil
-
Topic Author
- Away
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
26 Jun 2025 19:06 #330905
by Abdelrahmankandil
Replied by Abdelrahmankandil on topic Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
You mean the ini file or what ?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4425
- Thank you received: 1973
27 Jun 2025 04:45 - 27 Jun 2025 04:46 #330917
by Aciera
Replied by Aciera on topic Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
The whole folder that contains the ini file, the remap and everything else.
Right click on the folder and choose 'compress'.
Right click on the folder and choose 'compress'.
Last edit: 27 Jun 2025 04:46 by Aciera.
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- G&M Codes
- Python M6 Remap Not Callable in LinuxCNC 2.9.4– Function Not Recognized
Time to create page: 0.061 seconds