Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srikanthjoshi opened this issue Feb 12, 2020 · 2 comments
Open

Comments

@srikanthjoshi
Copy link

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) }

@JavaScriptDude
Copy link

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.

@JavaScriptDude
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants