Skip to main content
Solved

FME Desktop 2020.2 installing scipy library, numpy version error

  • February 28, 2022
  • 2 replies
  • 75 views

essb
Contributor
  • Contributor
  • 15 replies

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?

 

Best answer by debbiatsafe

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • 648 replies
  • Best Answer
  • February 28, 2022

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.


essb
Contributor
  • Author
  • Contributor
  • 15 replies
  • March 1, 2022

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