Hi @essb
numpy was upgraded to 1.18.5 for Python 3 in FME 2021. Are you able to upgrade to FME 2021? Note that you will have to install scipy again as FME 2021 includes a Python 3.8 interpreter so the previously installed Python 3.7 scipy will not work.
If you are unable to upgrade and you do not need to use the latest version of the scipy module, you can try installing an older version that is compatible with the FME 2020.2's shipped numpy module. For example, downloading scipy version 1.5.4 will work as it requires numpy 1.14.5 and higher. You can do so with this command:
fme python -m pip install scipy==1.5.4 --target C:\Users\<user>\Documents\FME\Plugins\Python\python37
If you require the latest version of the scipy module, try promoting the folder location of the newer numpy module in Python PATH. For example, add the following lines before importing scipy in your script:
import sys
sys.path.insert(0,r"C:\Users\<user>\Documents\FME\Plugins\Python\python37")
import scipy
This should ensure FME's Python interpreter searches the directory where the newer numpy modules are located first. This should allow the compatible numpy version to be loaded instead of the shipped numpy module.
Hi @essb
numpy was upgraded to 1.18.5 for Python 3 in FME 2021. Are you able to upgrade to FME 2021? Note that you will have to install scipy again as FME 2021 includes a Python 3.8 interpreter so the previously installed Python 3.7 scipy will not work.
If you are unable to upgrade and you do not need to use the latest version of the scipy module, you can try installing an older version that is compatible with the FME 2020.2's shipped numpy module. For example, downloading scipy version 1.5.4 will work as it requires numpy 1.14.5 and higher. You can do so with this command:
fme python -m pip install scipy==1.5.4 --target C:\Users\<user>\Documents\FME\Plugins\Python\python37
If you require the latest version of the scipy module, try promoting the folder location of the newer numpy module in Python PATH. For example, add the following lines before importing scipy in your script:
import sys
sys.path.insert(0,r"C:\Users\<user>\Documents\FME\Plugins\Python\python37")
import scipy
This should ensure FME's Python interpreter searches the directory where the newer numpy modules are located first. This should allow the compatible numpy version to be loaded instead of the shipped numpy module.
Thank you Debbie, the "sys.path.insert....." solved the problem, its working now! :)