pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ganesh Korde <ganeshakorde@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: ERROR: ImportError: No module named 'psutil'
Date: Sun, 1 Aug 2021 08:35:39 -0700
Message-ID: <113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com> (raw)
In-Reply-To: <CAPNyb0X=vq55ZWNuK1n+gfhPLy+J8KDn9XXcONKj30iZPYi+Kw@mail.gmail.com>
References: <CAPNyb0UKUn_RwvD+jtmo27CqPzrOa3Ae+JuzCcWwnNXvnwPMSg@mail.gmail.com>
	<CAPNyb0X=vq55ZWNuK1n+gfhPLy+J8KDn9XXcONKj30iZPYi+Kw@mail.gmail.com>

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.klaver@aklaver.com





view thread (7+ messages)  latest in thread

Message-ID: <113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com>
Permalink:  ../113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com/
Also on:    postgresql.org/message-id/113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: adrian.klaver@aklaver.com, ganeshakorde@gmail.com, pgsql-general@lists.postgresql.org
  Subject: Re: ERROR: ImportError: No module named 'psutil'
  In-Reply-To: <113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox