Question

FME server upgrade 2019 python libraries


Created a new instance with fme 2019.

While testing if the workspaces still work I've encountered different issues.

I have a workspace that requires, numpy, laspy,scipy,sklearn.

I have created a docker image with ubuntu 18, installed python3 and the necessary libraries and uploaded the files to Resources/Plugins/Python folder

( also tried creating the folder python36) 

The current version of numpy shipped with FME cloud is 1.13.3, when i run my workspaces i keep getting :

numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

I've tried adding an upgraded numpy version to the python folder but it will always use the default numpy installation.

I've uploaded different versions of scipy, but with no success

If i add the latest version of scipy i get :

 UserWarning: NumPy 1.14.5 or above is required for this version of SciPy (detected version 1.13.1)

 

 

Any ideas on how to fix this?


4 replies

Badge +2

I've done some testing myself with numpy versions in FME Cloud and can confirm the same behaviour, after loading a more recent numpy version into the FME Cloud resources it appears that FME still uses the shipped version of 1.13.3. (This is trying Resources  Engine  Plugins  python36  numpy and Resources  Engine  Plugins  Python  numpy)

I'm going to do some more investigations next week and see if there's a way to get the uploaded version of python to be used instead of the default version.

I'll keep this post updated.

Badge +2

An update:

 

There is a dependency of scipy 1.5.x that requires numpy 1.14.5 or higher

The current versions of FME ship with numpy 1.13.3 and we recommend to not alter this version if at all possible because this is the version that runs on the nightly tests and therefore is fully supported by us.

If it is at all possible for you to run a version of scipy lower then 1.5.x we would recommend to use it. 

The highest version of scipy requiring numpy 1.13.3 or higher is 1.4.1. I tested this version on a new FME Server 2019.2 instance and it imports fine. The easiest way to install it is to download and extract the python wheel for python 3.6 on Linux 64bit directly from PyPi and upload the files to Resources->Engine->Plugins->Python->python36.

 

Once you downloaded the wheel just unzip it (via CLI or some zip tool) and upload the 2 folders to Resources->Engine->Plugins->Python->python36 via drag & drop. For the FME Engines to pick up the new module they need to restart, so you can either restart the entire instance or simply drop the number engines to zero and then back to the original value. After that you should be able to import scipy successfully on a FME Server 2019.2 instance.

I also tested laspy 1.5.0 and it works fine. 

 

A more localized (workspace level) fix may be to try this at the beginning of your PythonCaller:

import sys
sys.path.insert(0, r"c:\users\admin\documents\fme\plugins\python\python36")
import numpy

 

where the path is the folder where a newer version of numpy is located. However, as mentioned above, using a different version of any module that we ship will not be supported by us (you would need to be using the default version, in this case numpy 1.13.1)

 

An update:

 

There is a dependency of scipy 1.5.x that requires numpy 1.14.5 or higher

The current versions of FME ship with numpy 1.13.3 and we recommend to not alter this version if at all possible because this is the version that runs on the nightly tests and therefore is fully supported by us.

If it is at all possible for you to run a version of scipy lower then 1.5.x we would recommend to use it. 

The highest version of scipy requiring numpy 1.13.3 or higher is 1.4.1. I tested this version on a new FME Server 2019.2 instance and it imports fine. The easiest way to install it is to download and extract the python wheel for python 3.6 on Linux 64bit directly from PyPi and upload the files to Resources->Engine->Plugins->Python->python36.

 

Once you downloaded the wheel just unzip it (via CLI or some zip tool) and upload the 2 folders to Resources->Engine->Plugins->Python->python36 via drag & drop. For the FME Engines to pick up the new module they need to restart, so you can either restart the entire instance or simply drop the number engines to zero and then back to the original value. After that you should be able to import scipy successfully on a FME Server 2019.2 instance.

I also tested laspy 1.5.0 and it works fine. 

 

A more localized (workspace level) fix may be to try this at the beginning of your PythonCaller:

import sys
sys.path.insert(0, r"c:\users\admin\documents\fme\plugins\python\python36")
import numpy

 

where the path is the folder where a newer version of numpy is located. However, as mentioned above, using a different version of any module that we ship will not be supported by us (you would need to be using the default version, in this case numpy 1.13.1)

 

Hi, I need to use sklearn as well,  will this be package be  part of future releases? is there another way to do regression line calcs? Using fme 2020.

Ta.

Badge +2

Hi, I need to use sklearn as well, will this be package be part of future releases? is there another way to do regression line calcs? Using fme 2020.

Ta.

@ldonofrio​ 

You can install (and upload) sklearn - just look at what version of numpy your FME is using (you can print the version in a python caller) and then look at the sklearn on pypi and find a version of sklearn that works with the FME shipped version of numpy.

If you're on desktop, check out this doc.

For FME Server/Cloud, use this doc.

Reply