I use the function “Execute Shell Script / Task” to execute a python script.
The python script imports the module psycopg2.
Based on the discussion here, I have set a environment variable as follows:
But I still encounter the following error in BTC:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/psycopg2/__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'
Please note that the script runs flawlessly in Terminal.
I can also import psycopg2 in Terminal (and confirm that psycopg2 does have a module called psycopg).
So the error does not come from a bad installation of psycopg2.
Current params are the following:
Adding the -q flag did have a positive effect: the script started!
Unfortunately, the script (backup of a local db) gets stuck again.
Same outcome as with attempt n°5/11, above (with import sys).
The function is a simple wrapper around pg_dump.
Yet the backup gets never produced.
(The script works flawlessly when I run it through Terminal).