Question

PythonCaller: cannot import pcl, receive Python Exception : numpy.ufunc has the wrong size, try recompiling"


Badge +2

After quite a lot of troubleshooting python packages, I have whittled the script in the PythonCaller down to simply importing some packages:

import fme
import fmeobjects
import pcl

class FeatureProcessor(object):
    def __init__(self):
        pass
        
    def input(self,feature):
        pass
        
    def close(self):
        pass

However, I still receive a Python Exception:

Python Exception <ValueError>: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216

which is being caused by importing pcl (python-pcl).

I AM, however, able to utilize this package directly in python using the same interpreter.  I only encounter this error from within FME.

I have found references to Cython throwing warnings (but not errors) due to a reference to an older numpy version (https://github.com/numpy/numpy/issues/12785#issuecomment-455336738), but it seems that issue has been addressed and I do not encounter any warnings when I run scripts directly.

At this point, I have to assume that the PythonCaller is at fault.  Does anyone out there have any other ideas?

 

I am using a custom python interpreter (I have tried both 3.7 & 3.6), which has had all of the applicable packages installed, on Windows 10 with FME Workbench 2019.0, build 19246.

 

 


2 replies

Userlevel 4

Could it somehow be due to a mix of 32- and 64-bit libraries?

Badge +2

Could it somehow be due to a mix of 32- and 64-bit libraries?

I don't think so, simply because I can import numpy independently with the PythonCaller and get no errors. It seems to me that some dependency of PCL may have been compiled with a previous version of numpy and is throwing a warning that FME may be interpreting as an error. But that seems odd, too. I can import PCL just fine in external scripts, without any warnings; it only seems to be an issue when I use the PythonCaller in FME.

Reply