Psutil: [OS] ImportError: cannot import name '_psutil_linux' on ppc64 RHEL8 LE

Created on 12 Feb 2020  路  2Comments  路  Source: giampaolo/psutil

Platform

  • { OS version } - RHEL8
  • { psutil version: python3 -c "import psutil; print(psutil.__version__)" }
  • { python version } 3.6.8

Bug description
I am trying to configure airflow on IBM POWER platform which is with ppc64 architecture. It is failing with error - "ImportError: cannot import name '_psutil_linux'"

I just tried to import psutil in python, even that is also giving same error :

(srikanth) [root@brazossrik01 psutil]# python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:34:02)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import psutil
Traceback (most recent call last):
File "", line 1, in
File "/root/anaconda3/envs/srikanth/lib/python3.6/site-packages/psutil/__init__.py", line 96, in
from . import _pslinux as _psplatform
File "/root/anaconda3/envs/srikanth/lib/python3.6/site-packages/psutil/_pslinux.py", line 26, in
from . import _psutil_linux as cext
ImportError: cannot import name '_psutil_linux'

I am assuming the problem seems to be It looks like we don't have psutil built for ppc64 architecture.

If not, please let me know what is the issue.

Test results
{ output of python -c psutil.tests (failures only, not full result) }

bug linux

Most helpful comment

Note: I was able to resolve by re-installing my python3.7 files using a PPA and then installing psutil in user mode (python3.7 -m pip install --user psutil). Once I did this, it worked fine. However, I still have not figured out how to get it working from a cron job. Seems like a different issue as it just cannot find the package and others I tested.

All 2 comments

Same here on Ubuntu 18.04:

% python3
Python 3.7.3 (default, May 19 2019, 22:17:35) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 100, in <module>
    from . import _pslinux as _psplatform
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: cannot import name '_psutil_linux' from 'psutil' (/usr/lib/python3/dist-packages/psutil/__init__.py)
>>> 

I tried the purge script from another issue and re-installing and it had no effect. Same problem.

Note: I was able to resolve by re-installing my python3.7 files using a PPA and then installing psutil in user mode (python3.7 -m pip install --user psutil). Once I did this, it worked fine. However, I still have not figured out how to get it working from a cron job. Seems like a different issue as it just cannot find the package and others I tested.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SimiCode picture SimiCode  路  3Comments

wemakeweb picture wemakeweb  路  3Comments

hkraal picture hkraal  路  5Comments

yegorich picture yegorich  路  11Comments

tbrownaw picture tbrownaw  路  5Comments