Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mADVJ-0001TJ-TF for pgsql-general@arkaria.postgresql.org; Sun, 01 Aug 2021 15:35:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mADVI-0006Qq-3B for pgsql-general@arkaria.postgresql.org; Sun, 01 Aug 2021 15:35:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mADVG-0006Ox-HE for pgsql-general@lists.postgresql.org; Sun, 01 Aug 2021 15:35:51 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mADVA-0005MR-3z for pgsql-general@lists.postgresql.org; Sun, 01 Aug 2021 15:35:45 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 82A495C009F; Sun, 1 Aug 2021 11:35:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 01 Aug 2021 11:35:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=h IPD7Crml9PUjfO/xp3IbvNZ4kQo7i6LlU7E7rdfBjg=; b=kU6G4/Ny9p/24eJJe DXv8uxABocE+FKDQLVoihKaIcQX1MHwy6RHkD4I/SACmkHL5XtFhPKRzx6rnG20B RgZdS3TgLGejGsd6z3RLuircpNSDB6If7ftqjtARNUIDkU4AAOifi9akF6FnGfIe bws6z9YuyBQwG367shgsfPg9oAsAOKAS2J5u+6tpcwP/oKZkJpGgt+1eE53Do8oe AclXrTav8BVHCHHQO/wYeS4gA15cu9UqetYtXIsoeju1jASpdmpO3FLyrRIf5PpY sYjwAkmFQ4p7MZqGwX1/lSFtXLsqtjAwvhhaA8eBQV69uh0iUfGum7vQyvWCZWnR JPiKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=hIPD7Crml9PUjfO/xp3IbvNZ4kQo7i6LlU7E7rdfB jg=; b=TLxDnarumaSUhw1ZuSO9vP1x0MlshphfEnxETMUdV6T3LEahDssQmU8Sz m8AzBd5uVsAFA3e8/o8J3HU43nePWcNjDFNvuHIUsGa4UFA8A8FMDDvNriH4PNzN s844TvxTZSkJo/s+N472bAgThaX0IKeQ+/gKRiZfIQO1OSRHEQWGrE4VVOKY0QQ0 tE6iAe46J4wDo+KZZ4g+w60c6NEMuhozb5/5pDDozAnNmhE1EEanyT4R+PY0zmef mGK2Q4CZVx3Tnp7WwGcNZyZroWZ2vkojaZ1afHN9yq7zSKWjIfgutnBQi2yJvo6v 9t0e2rpELmSaYX2Z4l/lDI5esDk6A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddriedtgdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepveevfeevfeeugeffkeekhfegieeufffgteeujedvgffh ueejjefhkeejleegtdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Aug 2021 11:35:40 -0400 (EDT) Subject: Re: ERROR: ImportError: No module named 'psutil' To: Ganesh Korde , pgsql-general References: From: Adrian Klaver Message-ID: <113c9dee-7126-79f3-0c78-03ecbba89f0b@aklaver.com> Date: Sun, 1 Aug 2021 08:35:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 >     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