psutil: psutil fails to install on python3.6 and Ubuntu16.04
install psutil with pip on python3.6 gives this error I’ve tried installing different versions of psutil with the same error
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_0xq2q7o/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-k4askr37-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_0xq2q7o/psutil/
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 23
- Comments: 30 (2 by maintainers)
I was just about to comment the same, after I read the install file: https://github.com/giampaolo/psutil/blob/master/INSTALL.rst However, if you have multiple versions installed (like me, I have python 3.4.3 and 3.5.4 installed), you need to specify a more granular version, like so:
sudo apt-get install python3.5-devAfter that, it installed without issuesYou guys need Python header files. On Ubuntu:
sudo apt-get install python-dev. On RedHat like distros it should besudo yum install python-devel.ubuntu 16.04 i helped
I had the same error using a virtual environment. And doing
sudo apt-get install python3.5-devdid not solve it at first.To solve it, I had to:
deactivatethe virtualenvsudo apt-get install python3.5-devsudo yum install python-develdoesnt work while you are using python 3 ,So trysudo yum install python3-develincase if you are running python 3 … It solved my issue 😃One more note that may be useful other people with this issue:
I’m using a RedHat distro and Python 2.7, and
sudo yum install python-develwasn’t resolving the issue. I eventually realized it was because, for some reason, that installed python-devel for Python 2.6.After a bit of googling I was able to resolve this issue with
sudo yum install python27-devel.x86_64, which installed python_devel for Python 2.7 after whichpip install psutilsucceeded.if you guys still have this issue just install gcc to your server
@Kosemii I got this error when trying to install tfds-nightly to install tensorflow datasets library. This solved my issue: sudo apt-get install python3.5-dev if you are working in 3.6 then replace 3.5 with 3.6
thanks, that works for me!