We regularly develop packages on MacOS, so that’s unexpected. We also use the interpreter from python.org in a virtualenv, configured using fme-packager config-env
. Is the value of sys.version
different between FME Python and your own installed Python?
Hi @carsonlam,
I made a point to match versions and thought they were both 3.13.5, but in reality FME is running 3.13.2 !
Is it published somewhere when they update the version, or do you just doublecheck with PythonCaller?
That was easy, many thanks!
-L
The quickest way to check the specific Python version is through PythonCaller or ./fme python
to open a REPL.
Even though your FME has Python 3.13.2, its binaries for fmeobjects should still be compatible with Python 3.13.5, so it’s strange that the mismatch appears to make it not work.
FME 2025.1.1 b25615, released last week, should include Python 3.13.5 for MacOS.
I usually work on a PC, so it’s hard to know sometimes if it’s me or MacOS.
To be clear, you do NOT need to alter the fme_env.pth file? Here is what I get:
#/Library/FME/2025.1/python
/Library/FME/2025.1/python/python
/Library/FME/2025.1/python/python/fme-plugins-py313.zip
/Library/FME/2025.1/python/python/python313
/Library/FME/2025.1/python/fmeobjects/python313
import fme_env
To get any further with the setup, I had to delete everything except for the top line, which I uncommented.
Let me try the new build and we’ll see what happens.
Based on your fme_env.pth, it looks like fme-packager config-env
is working with a FME_HOME value of /Library/FME/2025.1/python. It should instead be /Library/FME/2025.1. Your environment should be set up after config-env without needing any manual edits to fme_env.pth.
Well, I installed 2025.1.1 and the versions now match at 3.13.5. Still can’t get past the ‘import fmeobjects’ test. Module was not found.
When I ran fme-packager config-env, it would not accept /Library/FME/2025.1, nor /Library/FME/2025.1/python. They did ‘not exist’.
It would only finish if I used /Library/FME/2025.1/Apps/FME Workbench 2025.1.app/Contents or /Applications/FME 2025.1/FME Workbench 2025.1.app/Contents
I had to give r&w access to these folders, and still no dice. Any ideas? This is ridiculous.
You’ve found a bug where fme-packager config-env requires FME_HOME to be a writeable folder. That’s not needed. I’ll get that fixed.
In the meantime, for your specific case of getting fmeobjects on Mac, just replace the contents of fme_env.pth with /Library/FME/2025.1/python
. That should fix the ModuleNotFoundError that you’re getting from import fmeobjects
.
If you’re getting a different kind of ImportError, or a process crash, then please share the output and we’ll investigate further.
I think I got a clean venv now, but it still crashes at import fmeobjects:
Time Awake Since Boot: 360 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Codes: 0x0000000000000001, 0x0000000000000010
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler s1014]
VM Region Info: 0x10 is not in any region. Bytes before following region: 4297900016
REGION TYPE START - END VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 1002cc000-1002d0000 16K] r-x/r-x SM=COW /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libpython3.13.dylib 0x102161978 PyDict_New + 32
1 libpython3.13.dylib 0x10219a7cc type_ready + 504
2 fmeobjects.cpython-313-darwin.so 0x100d31d8c PyInit_fmeobjects + 48
3 Python 0x101684754 _PyImport_RunModInitFunc + 84
4 Python 0x101681294 import_run_extension + 92
5 Python 0x10168331c _imp_create_dynamic + 936
6 Python 0x1014f1650 cfunction_vectorcall_FASTCALL + 96
7 Python 0x101618acc _PyEval_EvalFrameDefault + 54736
8 Python 0x10146ff9c _PyObject_VectorcallTstate.824 + 72
9 Python 0x101472324 object_vacall + 244
10 Python 0x1014721bc PyObject_CallMethodObjArgs + 108
11 Python 0x1016803a8 PyImport_ImportModuleLevelObject + 3316
12 Python 0x1016271ac _PyEval_EvalFrameDefault + 113840
13 Python 0x1016095f8 PyEval_EvalCode + 132
14 Python 0x101603704 builtin_exec + 396
15 Python 0x1014f1778 cfunction_vectorcall_FASTCALL_KEYWORDS + 88
16 Python 0x1016154b8 _PyEval_EvalFrameDefault + 40892
17 Python 0x1016095f8 PyEval_EvalCode + 132
18 Python 0x101603704 builtin_exec + 396
19 Python 0x1014f1778 cfunction_vectorcall_FASTCALL_KEYWORDS + 88
20 Python 0x1016154b8 _PyEval_EvalFrameDefault + 40892
21 Python 0x1016dfc88 pymain_run_module + 196
22 Python 0x1016df6d8 Py_RunMain + 1504
23 Python 0x1016e0cb8 pymain_main + 436
24 Python 0x1016e0e14 Py_BytesMain + 40
25 dyld 0x1986d3154 start + 2476
Thanks for the report. I’ve filed a ticket with those details for the responsible team to investigate.
Much appreciated. They are welcome to reach out if they need more info or a real-time demo.
-L
As a workaround to this problem, instead of using a Python from python.org, make a virtualenv from the Python interpreter included with Mac FME: /Library/FME/2025.1/fmepython313/bin/python3 -m venv .venv
Then proceed as before: run fme-packager config-env
and replace the contents of fme_env.pth with /Library/FME/2025.1/python.
I managed to get through import fmeobjects, all the way to setting up the package with
fme-packager init transformer. Couldn’t get past installing dependencies though:
fme_demogreeter % pip install -e .adev]
zsh: no matches found: .fdev]
For zsh, use pip install -e '..dev]'
Hi @carsonlam,
Thanks again for your help. I managed to get a package made yesterday with only .fmx files (no Python ready yet). It would be nice to have the same interface as the Python ones, but it worked as designed.
One thing you might want to look into:
When using
fme-packager pack
I was getting errors regarding the Category. What I found was that the categories which are in quotes, like “Format Specific”, cause the error. Once I set Category to only Geometry, it was all good.
Here is a snippet of a header showing the issue:
#! <TRANSFORMER
# TRANSFORMER_BEGIN CAD_WALL_PREPold,1,"""Format Specific"",Geometries",02b44c6d-15d0-4ab3-812f-0bd183c3f062,"Embedded Always",No,NO_PARALLELISM,$(FME_PROCESS_GROUP_BY),No,25615,YES,No,313,No,,both
#
The error pointed to this function:
def parse_custom_transformer_header(line):
"""
Parses custom transformer header.
:param str line: Custom transformer header line from FMX.
:return: Parsed header
"""
fields = line.replace("# TRANSFORMER_BEGIN", "").strip().split(",")
header = NamedTransformerHeader(*fieldsf: len(NamedTransformerHeader._fields)])
return header._replace(version=int(header.version), build_num=int(header.build_num))
I have a feeling the extra quotes were the issue. What do you think?
Best,
@larue
There’s a problem with the handling of multi-category custom transformers. I have a fix ready, and it’ll be included in the next release of fme-packager.