Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of error reporting when installing psutil module

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to solve the problem of installing psutil module error". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian to study and learn "how to solve the problem of installing psutil module error" together.

'*' token

psutil/_psutil_linux.c:190: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:240: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:268: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:375: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:433: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:482: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

psutil/_psutil_linux.c:543: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PsutilMethods'

psutil/_psutil_linux.c:582: error: expected specifier-qualifier-list before 'PyObject'

psutil/_psutil_linux.c: In function 'init_psutil_linux':

psutil/_psutil_linux.c:628: error: 'PyObject' undeclared (first use in this function)

psutil/_psutil_linux.c:628: error: (Each undeclared identifier is reported only once

psutil/_psutil_linux.c:628: error: for each function it appears in.)

psutil/_psutil_linux.c:628: error: 'v' undeclared (first use in this function)

psutil/_psutil_linux.c:632: error: 'module' undeclared (first use in this function)

psutil/_psutil_linux.c:632: warning: implicit declaration of function 'Py_InitModule'

psutil/_psutil_linux.c:632: error: 'PsutilMethods' undeclared (first use in this function)

psutil/_psutil_linux.c:635: warning: implicit declaration of function 'PyModule_AddIntConstant'

error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cY1TLx/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-J4cL69-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-cY1TLx/psutil/

===============================================================

The workaround is to install python-devel, which is Python's header file and static library package:

[root@localhost ~]# yum install python-devel.x86_64

Failed to set locale, defaulting to C

Loaded plugins: product-id, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package python-devel.x86_64 0:2.6.6-51.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================

Package Arch Version Repository Size

===============================================================================================

Installing:

python-devel x86_64 2.6.6-51.el6 cdrom-server 171 k

Transaction Summary

===============================================================================================

Install 1 Package(s)

Total download size: 171 k

Installed size: 456 k

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : python-devel-2.6.6-51.el6.x86_64 1/1

Verifying : python-devel-2.6.6-51.el6.x86_64 1/1

Installed:

python-devel.x86_64 0:2.6.6-51.el6

Complete!

Install psutil module with pip

[root@localhost ~]# pip install psutil

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6

Collecting psutil

Using cached psutil-5.0.1.tar.gz

Installing collected packages: psutil

Running setup.py install for psutil ... done

Successfully installed psutil-5.0.1

Thank you for reading, the above is the "installation psutil module error how to solve" content, after the study of this article, I believe that we have a deeper understanding of how to install psutil module error how to solve this problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report