Hi,
I got the issue Failed buiding wheel for psutil when I want to install Glances.
- Glances version: develop branch
- Python version: 3.5.1
- psutil version: 3.3.0
- OS version : ArchLinux (rolling release):
Linux arch-server 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux
- Error message:
[root@arch-server ~]# ~/glances-venv/bin/pip install psutil
Collecting psutil
Using cached psutil-3.3.0.tar.gz
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil
Complete output from command /root/glances-venv/bin/python3 -c "import setuptools;__file__='/tmp/pip-build-0cqcuz53/psutil/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp_l9n4ss2pip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.5/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.5/psutil
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/psutil
gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -DPSUTIL_VERSION=330 -I/usr/include/python3.5m -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-3.5/psutil/_psutil_linux.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-x86_64-3.5/psutil/_psutil_linux.o -L/usr/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/psutil/_psutil_linux.cpython-35m-x86_64-linux-gnu.so
building 'psutil._psutil_posix' extension
gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -I/usr/include/python3.5m -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-3.5/psutil/_psutil_posix.o
psutil/_psutil_posix.c: Dans la fonction ‘psutil_convert_ipaddr’:
psutil/_psutil_posix.c:141:23: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
for (n = 0; n < len; ++n) {
^
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-x86_64-3.5/psutil/_psutil_posix.o -L/usr/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/psutil/_psutil_posix.cpython-35m-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_psutil_posix.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_psutil_linux.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/__init__.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_compat.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_common.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_psosx.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_pssunos.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_psbsd.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_psposix.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_pslinux.py -> build/bdist.linux-x86_64/wheel/psutil
copying build/lib.linux-x86_64-3.5/psutil/_pswindows.py -> build/bdist.linux-x86_64/wheel/psutil
running install_egg_info
running egg_info
writing dependency_links to psutil.egg-info/dependency_links.txt
writing psutil.egg-info/PKG-INFO
writing top-level names to psutil.egg-info/top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'psutil.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: manifest_maker: MANIFEST.in, line 18: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
writing manifest file 'psutil.egg-info/SOURCES.txt'
Copying psutil.egg-info to build/bdist.linux-x86_64/wheel/psutil-3.3.0-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0cqcuz53/psutil/setup.py", line 268, in <module>
main()
File "/tmp/pip-build-0cqcuz53/psutil/setup.py", line 265, in main
setup(**setup_args)
File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for psutil
Failed to build psutil
Installing collected packages: psutil
Running setup.py install for psutil
Successfully installed psutil-3.3.0
[root@arch-server ~]# ~/glances-venv/bin/pip install wheel
Requirement already satisfied (use --upgrade to upgrade): wheel in ./glances-venv/lib/python3.5/site-packages
[root@arch-server ~]# ~/glances-venv/bin/pip install psutil
Requirement already satisfied (use --upgrade to upgrade): psutil in ./glances-venv/lib/python3.5/site-packages
[root@arch-server ~]# ~/glances-venv/bin/pip install zeroconf
Collecting zeroconf
Using cached zeroconf-0.17.4-py2.py3-none-any.whl
Collecting enum-compat (from zeroconf)
Using cached enum-compat-0.0.2.tar.gz
Collecting netifaces (from zeroconf)
Using cached netifaces-0.10.4.tar.gz
Collecting six (from zeroconf)
Using cached six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: enum-compat, netifaces
Running setup.py bdist_wheel for enum-compat
Complete output from command /root/glances-venv/bin/python3 -c "import setuptools;__file__='/tmp/pip-build-oxtxj9v3/enum-compat/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp2mmv5z_ppip-wheel-:
running bdist_wheel
running build
installing to build/bdist.linux-x86_64/wheel
running install
running install_egg_info
running egg_info
writing dependency_links to enum_compat.egg-info/dependency_links.txt
writing enum_compat.egg-info/PKG-INFO
writing top-level names to enum_compat.egg-info/top_level.txt
deleting enum_compat.egg-info/requires.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'enum_compat.egg-info/SOURCES.txt'
writing manifest file 'enum_compat.egg-info/SOURCES.txt'
Copying enum_compat.egg-info to build/bdist.linux-x86_64/wheel/enum_compat-0.0.2.data/purelib/enum_compat-0.0.2-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-oxtxj9v3/enum-compat/setup.py", line 45, in <module>
install_requires=[] if has_enum else ['enum34'],
File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for enum-compat
Running setup.py bdist_wheel for netifaces
Complete output from command /root/glances-venv/bin/python3 -c "import setuptools;__file__='/tmp/pip-build-oxtxj9v3/netifaces/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpk3c2kz41pip-wheel-:
running bdist_wheel
running build
running build_ext
checking for getifaddrs...found.
checking for getnameinfo...found.
checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
checking whether struct sockaddr has a length field...no.
checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda llc.
checking for routing socket support...no.
checking for sysctl(CTL_NET...) support...no.
checking for netlink support...yes.
will use netlink to read routing table
building 'netifaces' extension
gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -DNETIFACES_VERSION=0.10.4 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/usr/include/python3.5m -c netifaces.c -o build/temp.linux-x86_64-3.5/netifaces.o
netifaces.c: Dans la fonction ‘string_from_sockaddr’:
netifaces.c:390:16: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
if (buflen < 3 * len)
^
netifaces.c: Dans la fonction ‘gateways’:
netifaces.c:1587:33: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
if (pmsg->hdr.nlmsg_seq != seq || pmsg->hdr.nlmsg_pid != sanl.nl_pid)
^
creating build/lib.linux-x86_64-3.5
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-x86_64-3.5/netifaces.o -L/usr/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/netifaces.cpython-35m-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
copying build/lib.linux-x86_64-3.5/netifaces.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel
running install_egg_info
running egg_info
writing top-level names to netifaces.egg-info/top_level.txt
writing netifaces.egg-info/PKG-INFO
writing dependency_links to netifaces.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'netifaces.egg-info/SOURCES.txt'
writing manifest file 'netifaces.egg-info/SOURCES.txt'
Copying netifaces.egg-info to build/bdist.linux-x86_64/wheel/netifaces-0.10.4-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-oxtxj9v3/netifaces/setup.py", line 533, in <module>
ext_modules=[iface_mod])
File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/root/glances-venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for netifaces
Failed to build enum-compat netifaces
Installing collected packages: enum-compat, netifaces, six, zeroconf
Running setup.py install for enum-compat
Running setup.py install for netifaces
Successfully installed enum-compat-0.0.2 netifaces-0.10.4 six-1.10.0 zeroconf-0.17.4
[root@arch-server ~]# ~/glances-venv/bin/pip install netifaces
Requirement already satisfied (use --upgrade to upgrade): netifaces in ./glances-venv/lib/python3.5/site-packages
[root@arch-server ~]# ~/glances-venv/bin/pip install bottle
Collecting bottle
Using cached bottle-0.12.9.tar.gz
Building wheels for collected packages: bottle
Running setup.py bdist_wheel for bottle
Stored in directory: /root/.cache/pip/wheels/0f/bd/f7/21e856551fa937e3c8a9d9592fd74a50714af336b8ee4f42c7
Successfully built bottle
Installing collected packages: bottle
Successfully installed bottle-0.12.9
[root@arch-server ~]# ~/glances-venv/bin/pip install influxdb
Collecting influxdb
Using cached influxdb-2.10.0-py2.py3-none-any.whl
Collecting pytz (from influxdb)
Using cached pytz-2015.7-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in ./glances-venv/lib/python3.5/site-packages (from influxdb)
Collecting requests>=1.0.3 (from influxdb)
Using cached requests-2.9.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.0.0 (from influxdb)
Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Installing collected packages: pytz, requests, python-dateutil, influxdb
Successfully installed influxdb-2.10.0 python-dateutil-2.4.2 pytz-2015.7 requests-2.9.0
[root@arch-server ~]# ~/glances-venv/bin/pip install influxdb^C
[root@arch-server ~]# ~/glances-venv/bin/pip install potsdb
Collecting potsdb
Installing collected packages: potsdb
Successfully installed potsdb-1.0.2
[root@arch-server ~]# ~/glances-venv/bin/pip install statsd
Collecting statsd
Using cached statsd-3.2.1-py2.py3-none-any.whl
Installing collected packages: statsd
Successfully installed statsd-3.2.1
[root@arch-server ~]# ~/glances-venv/bin/pip install pika
Collecting pika
Using cached pika-0.10.0-py2.py3-none-any.whl
Installing collected packages: pika
Successfully installed pika-0.10.0
[root@arch-server ~]# ~/glances-venv/bin/pip install pystache
Collecting pystache
Installing collected packages: pystache
Successfully installed pystache-0.5.4
[root@arch-server ~]# ~/glances-venv/bin/pip install docker-py
Collecting docker-py
Using cached docker-py-1.6.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests>=2.5.2 in ./glances-venv/lib/python3.5/site-packages (from docker-py)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.0 in ./glances-venv/lib/python3.5/site-packages (from docker-py)
Collecting websocket-client>=0.32.0 (from docker-py)
Using cached websocket_client-0.34.0.tar.gz
Building wheels for collected packages: docker-py, websocket-client
Running setup.py bdist_wheel for docker-py
Stored in directory: /root/.cache/pip/wheels/e6/d9/a1/fe57c3e479387975813b221e7f01dcaa0f73e9149744472c71
Running setup.py bdist_wheel for websocket-client
Stored in directory: /root/.cache/pip/wheels/c2/af/03/d3899019a2100d8b39625e578e8680f444096278d16b7dc4a4
Successfully built docker-py websocket-client
Installing collected packages: websocket-client, docker-py
Successfully installed docker-py-1.6.0 websocket-client-0.34.0
[root@arch-server ~]# ~/glances-venv/bin/pip install py-cpuinfo
Collecting py-cpuinfo
Installing collected packages: py-cpuinfo
Successfully installed py-cpuinfo-0.1.6
[root@arch-server ~]# ~/glances-venv/bin/pip install https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz
Collecting https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz
Downloading https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz
Installing collected packages: PySensors
Running setup.py install for PySensors
Successfully installed PySensors-0.0.2
- Log file: it’s just during the installation, I’m wondering why I’m getting these kind of messages in red:
- Failed building wheel for psutil
- Failed building wheel for enum-compat
- Failed building wheel for netifaces
As asked here nicolargo/glances#757: I report this issue also to your bug tracker.
I am trying to install psutil in centos and same is failing with gcc error . I have referred various posts in this forum but none of them helped . Many threads suggested to use pydev but its already there in my system
#sudo /opt/airwave/bin/pip install psutil
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=543 -DPSUTIL_LINUX=1 -I/opt/airwave/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: error: Python.h: No such file or directory
psutil/_psutil_common.c:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_common.c:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_common.c:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_common.c:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_common.c:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_common.c: In function 'psutil_debug':
psutil/_psutil_common.c:87: warning: implicit declaration of function 'va_start'
psutil/_psutil_common.c:91: warning: implicit declaration of function 'va_end'
psutil/_psutil_common.c: In function 'psutil_setup':
psutil/_psutil_common.c:100: warning: implicit declaration of function 'getenv'
psutil/_psutil_common.c:100: warning: comparison between pointer and integer
psutil/_psutil_common.c:102: warning: comparison between pointer and integer
error: command 'gcc' failed with exit status 1
gcc is available
[root@localhost /]# yum install gcc
Loaded plugins: downloadonly, fastestmirror, presto, security, verify, versionlock
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Package gcc-4.4.7-18.el6.x86_64 already installed and latest version
Nothing to do
[root@localhost /]#
python-devel is also in place
Loaded plugins: downloadonly, fastestmirror, presto, security, verify, versionlock
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Package python-devel-2.6.6-66.el6_8.x86_64 already installed and latest version
Nothing to do
Python version is 2.7.4
[root@localhost /]# python
Python 2.7.4 (default, Apr 17 2013, 09:54:46)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Python.h file is available
[root@localhost /]# find / -name Python.h
/usr/include/python2.6/Python.h
[root@localhost /]#
There are two instances of python available (default version 2.6 and user installed 2.7)
[root@localhost jvm]# /usr/bin/python
Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[root@localhost jvm]# /opt/airwave/bin/python
Python 2.7.4 (default, Apr 17 2013, 09:54:46)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
So when I try yum install python-devel
, its installing python dev package for python2.6 but I want yum to install python-devel
for python 2.7
Check and let me know if you need any information
Мы получаем ошибку при настройке интерпретатора Pypy, который мы уже установили, следуя командам
sudo yum install python-devel
sudo yum install gcc
Когда работает:
git clone https://github.com/giampaolo/psutil.git
cd psutil
python setup.py install
Мы получаем следующую ошибку:
running install <br>
running bdist_egg <br>
running egg_info <br>
writing requirements to psutil.egg-info/requires.txt <br>
writing psutil.egg-info/PKG-INFO <br>
writing top-level names to psutil.egg-info/top_level.txt <br>
writing dependency_links to psutil.egg-info/dependency_links.txt <br>
reading manifest file 'psutil.egg-info/SOURCES.txt' <br>
reading manifest template 'MANIFEST.in' <br>
writing manifest file 'psutil.egg-info/SOURCES.txt' <br>
installing library code to build/bdist.linux-x86_64/egg <br>
running install_lib <br>
running build_py <br>
running build_ext <br>
building 'psutil._psutil_linux' extension <br>
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=548 -DPSUTIL_LINUX=1 -I/usr/local/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o <br>
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory <br>
#include <Python.h> <br>
^ <br>
compilation terminated. <br>
error: command 'gcc' failed with exit status 1 <br>
You have mail in /var/spool/mail/root <br> <br> <br>
Эта ошибка
pip install psutil
Collecting psutil <br>
Using cached <br>https://files.pythonhosted.org/packages/7d/9a/1e93d41708f8ed2b564395edfa3389f0fd6d567597401c2e5e2775118d8b/psutil-5.4.7.tar.gz <br>
Building wheels for collected packages: psutil <br>
Running setup.py bdist_wheel for psutil ... error <br>
Complete output from command /usr/local/bin/python2.7 -u -c "import <br>setuptools, tokenize;__file__='/tmp/pip-build-O38Z8x/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpU_ZGtJpip-wheel- --python-tag cp27: <br>
running bdist_wheel <br>
running build <br>
running build_py <br>
creating build <br>
creating build/lib.linux-x86_64-2.7 <br>
creating build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_exceptions.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psaix.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil <br>
creating build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
running build_ext <br>
building 'psutil._psutil_linux' extension <br>
creating build/temp.linux-x86_64-2.7 <br>
creating build/temp.linux-x86_64-2.7/psutil <br>
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=547 -DPSUTIL_LINUX=1 -I/usr/local/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o <br>
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h> <br>
^ <br>
compilation terminated. <br>
error: command 'gcc' failed with exit status 1 <br>
---------------------------------------- <br>
Failed building wheel for psutil <br>
Running setup.py clean for psutil <br>
Failed to build psutil <br>
Installing collected packages: psutil <br>
Running setup.py install for psutil ... error <br>
Complete output from command /usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-O38Z8x/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-iGEGm2-record/install-record.txt --single-version-externally-managed --compile: <br>
running install <br>
running build <br>
running build_py <br>
creating build <br>
creating build/lib.linux-x86_64-2.7 <br>
creating build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_exceptions.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psaix.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil <br>
copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil <br>
creating build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/psutil/tests <br>
running build_ext <br>
building 'psutil._psutil_linux' extension <br>
creating build/temp.linux-x86_64-2.7 <br>
creating build/temp.linux-x86_64-2.7/psutil <br>
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=547 -DPSUTIL_LINUX=1 -I/usr/local/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o <br>
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory <br>
#include <Python.h> <br>
^ <br>
compilation terminated. <br>
error: command 'gcc' failed with exit status 1 <br>
Даже выполнили все решения, приведенные по следующей ссылке
https://github.com/giampaolo/psutil/issues/1143
Проблема с соответствующим Pypy интерпретатором и установка работает нормально с Python
0
Решение
Для PyPy вам нужен пакет pypy-devel
0
Другие решения
Других решений пока нет …