Skip to main content

We have a PythonCaller which uses the psycopg2 import statement and then uses the pgsql server parameters to connect to a pgsql server and create database ((eg: https://wiki.postgresql.org/wiki/Using_psycopg2_with_PostgreSQL). This works fine in FME Desktop 2021.1 and FME Server 2021.1

Currently we are migrating to FME Flow 2025.1 and this caller fails when run in Flow (server) and local desktop in Form, both in 2025.1. The location of the psycopg2 package is in \Documents\FME\Plugins\Python folder in the local desktop. With same setting, it works in 2021.1, but not in 2025.1

Have I missed anything?

The specifc error is: No module named psycopg2._psycopg

 

?name=image.png

2021 and 2025 will be using different versions of Python. Even though you have the libraries on your computer, it’s possible that only 2021s Python knows they’re there.

Have a look through here to see how to install them on 2025
https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/Workbench/Installing-Python-Packages.htm


Thanks ​@hkingsbury indeed, it was due to Python paths were not defined in the env variables. Once that is done, it works fine locally. When the new compatible psycopg2 version is updated to server plugin folder, it works there too.


Reply