Forum Discussion

Ryu's avatar
Ryu
Contributor
8 years ago
Solved

Python in TestComplete - having trouble importing psutil

I am trying to import the psutil library for use in my tests with the following:

 

import sys
sys.path.insert(0, "C:\\Python\\Python36-32\\Lib\\site-packages\\psutil\\psutil-5.4.5-cp35-cp35m-win32.whl")

import psutil

 

Every time, I will get this error:

Python runtime error. ImportError: cannot import name '_psutil_windows'

 

I get the same error if I point PATH to the residing folder instead of the .whl file.  I get a "module not found" error if I point PATH to the site-packages folder.  What am I doing wrong?

 

Version info:

TC Version 12.5

TC Python Version: 3.6.0

Local Python Version: 3.6.0

pip version: 10.0.1 

psutil version: 5.4.5