Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : No module named 'psutil'

Tags:

python

psutil

I've been trying to install Peter Chervenski's MultiNEAT and ran into a problem while running setup.py (python setup.py build_ext):

File "c:/Users/1234/Documents/Alex/multineat/peter-ch-MultiNEAT-f631e2f/setup.py", line 7, in from site-packages import psutil'

And I made sure this module is installed: used pip install a couple of times and it said:

Requirement already satisfied: psutil in c:\users\1234\appdata\local\programs\python\python36-32\lib\site-packages

And I checked this directory myself and found psutil module there (I even deleted it and reinstalled one more time). And after that, I still got the same error with Python not seeing psutil. Is there any way I can solve this problem? (I am using Windows 10, latest version of Python)

like image 246
SeyVetch Avatar asked May 13 '18 12:05

SeyVetch


People also ask

How do I add Psutil to Python?

Type "cmd" in the search bar and hit Enter to open the command line. What is this? Type “ pip install psutil ” (without quotes) in the command line and hit Enter again. This installs psutil for your default Python installation.

Is Psutil included in Python?

It is supported in Python versions 2.6, 2.7, and 3.4+.


2 Answers

Error I got in windows 10 while executing a python script ->

Traceback (most recent call last):

File "C:\Users\YOUR NAME\Desktop\Sample.py", line 2, in import psutil

ImportError: No module named psutil

This is how I resolved the issue ->

C:\python -m pip install --upgrade pip

[Latest pip version got installed successfully]

C:\>python -m pip install psutil

Collecting psutil
  Downloading https://files.pythonhosted.org/packages/50/6a/34525bc4e6e153bf6e849a4c4e936742b365f6819c0462cebfa4f082a3c4/psutil-5.4.7-cp27-none-win_amd64.whl (220kB)
    100% |UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 225kB 696kB/s
Installing collected packages: psutil
Successfully installed psutil-5.4.7

Finally, Sample.py got executed successfully

like image 197
sai Avatar answered Sep 20 '22 17:09

sai


This worked for me..

sudo pip install --upgrade psutil
like image 21
Jadhav Gaurav Avatar answered Sep 17 '22 17:09

Jadhav Gaurav