Solved

FME Desktop 2020.2 installing scipy library, numpy version error

  • 28 February 2022
  • 2 replies
  • 7 views

Hi

windows 10, FME desktop 2020.2.5

 

I installed scipy using pip

"fme.exe python -m pip install numpy --target C:\\Users\\<user>\\Documents\\FME\\Plugins\\Python\\python37 "

 

I check numpy version and it says 1.16.5 using pip list in commando prompt.

 

But when I run the script in FME desktop it says

ERROR |C:\\Users\\<my username here>\\AppData\\Roaming\\Python\\Python37\\site-packages\\scipy\\__init__.py:149: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.15.1

UserWarning)

 

But the only version of numpy that i have installed is 1.16.5.

 

Any suggestions on how I can fix this problem?

 

icon

Best answer by debbiatsafe 28 February 2022, 20:52

View original

2 replies

Userlevel 3
Badge +17

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! :)

Reply