Solved

Installed Python package not found

  • 1 March 2023
  • 7 replies
  • 166 views

Badge +3

Hello,

I have pip installed a python package to FME Desktop using the advice on the site:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Desktop/Workbench/Installing-Python-Packages.htm

The package shows in the correct folder:

imageHowever when I try to import the package into the PythonCreator FME tells me it doesn't exist:

imageCan anyone please tell me what I am doing wrong?

Thank you

icon

Best answer by debbiatsafe 2 March 2023, 22:34

View original

7 replies

Userlevel 1
Badge +22

Hi Ned.

Is the folder included in the PYTHON_PATH environment variable ?

FME also adds some folders automatically to this variable during runtime, which you can see in the top of the log file when running a workspace.

Beware of Python versions. Not all modules work in all versions.

Badge

A common issue I have had is FME Python and external Python version compatibilities. If you have non-compatible versions there is a little warning in the log file that FME is ignoring the non-compatible version and reverting to the native version. This occurs when setting a preferred python interpreter. If the package is not compatible I don't know if you would get a message or not.

Badge +3

Thanks both for the replies - I will check all this out and see if that fixes the issue!

 

Userlevel 4

Seeing that this version of MButil dates from 2017, I'm suspecting it might not support Python 3. Perhaps try installing the package into the Python27 subfolder and setting the workspace Python version to 2.7 (won't be compatible with FME 2022+).

Badge +3

Thanks David - I have tried that in FME 2021 but am still getting the same message. It might be that it has not successfully installed, so I will check with my python expert, as I'm not one.

 

Userlevel 3
Badge +17

Hello @nedwaterman​ 

Did you use an elevated command prompt to install the Python package using pip? We've had previous reports where a similar error occurs when packages are installed as an administrator (elevated privileges) but FME Desktop was not run as an administrator. It creates a file permission issue on the user directory in which the Python modules are installed.

Badge +3

Ah - no I didn't. I'll give this a try and see if it fixes the issue. Thanks for the tip!

Reply