Skip to main content
Solved

Unable to connect to PostgreSQL database server - FME Form 2025.1 - No module named psycopg2._psycopg

  • August 6, 2025
  • 2 replies
  • 60 views

tp_atkins
Contributor
Forum|alt.badge.img+1

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

Best answer by hkingsbury

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

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

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1625 replies
  • Best Answer
  • August 6, 2025

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


tp_atkins
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • 3 replies
  • August 7, 2025

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.