Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 8/1/21 7:40 AM, Ganesh Korde wrote:
>> I am trying to run a python function using the language plpython3u and
>> I am getting the below error, though I have installed psutil.
>>
>> postgres=# select * from get_psutil_mem();
>> ERROR: ImportError: No module named 'psutil'
> How did you install plpython3u?
> How did you install psutil?
Experimenting locally, I observe something that seems relevant:
I get that error message phrasing from python *2*. In python 3,
an unknown module name draws "ModuleNotFoundError":
$ python3
Python 3.6.8 (default, Mar 18 2021, 08:58:41)
[GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from z import virtual_memory, swap_memory
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'z'
Now it's possible that the wording didn't change exactly at the 2/3
boundary, but I doubt it. So it looks to me like the alleged plpython3u
language is actually invoking python 2.something, which is unlikely
to work well at all.
regards, tom lane