Re: ERROR: ImportError: No module named 'psutil'

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ganesh Korde <ganeshakorde(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: ERROR: ImportError: No module named 'psutil'
Date: 2021-08-01 15:35:39
Message-ID: 113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On 8/1/21 7:40 AM, Ganesh Korde wrote:
> Hi Everyone,
>
> Environment
> OS : Linux ubuntu 4.4.0-87-generic
> Database:  PostgreSQL 10.7 on x86_64-pc-linux-gnu,
> Extension: plpython3u
> Python version: Python 3.5.2
>
>  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'
> CONTEXT:  Traceback (most recent call last):
>   PL/Python function "get_psutil_mem", line 2, in <module>
>     from psutil import virtual_memory, swap_memory
> PL/Python function "get_psutil_mem"
>

> The above function is used by pgwatch2 to monitor memory.
>
> *I tried installing python3.4.3 from source code but still the same
> error.* Also tried most of the solutions provided on the internet but
> nothing helped. Problem is with the psutil module only.
>
> Please let me know if I am missing anything.

How did you install plpython3u?

How did you install psutil?

>
> Any help will be much appreciated.
>
> Regards,
> Ganesh Korde.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2021-08-01 15:51:03 Re: ERROR: ImportError: No module named 'psutil'
Previous Message Ganesh Korde 2021-08-01 14:40:07 ERROR: ImportError: No module named 'psutil'

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-08-01 15:51:03 Re: ERROR: ImportError: No module named 'psutil'
Previous Message Tom Lane 2021-08-01 15:30:00 Re: postgres vacuum memory limits