python3.6์์ pip๋ก psutil์ ์ค์นํ๋ฉด์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
๋์ผํ ์ค๋ฅ๋ก ๋ค๋ฅธ ๋ฒ์ ์ psutil์ ์ค์นํ๋ ค๊ณ ํ์ต๋๋ค.
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/
์ฌ๊ธฐ์ pip๊ฐ ๋ถํํ๋ ์ค์น ๋ก๊ทธ๋ฅผ ๊ฒ์ ํ ์ ์์ต๋๊น?
Ubuntu 14.04์์ python 3.5.4๋ฅผ ์ฌ์ฉํ์ฌ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ ์๋ ๋ก๊ทธ๋ฅผ ์ค์นํ์ญ์์ค.
pip3 install psutil
Collecting psutil
Using cached psutil-5.3.1.tar.gz
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
Complete output from command /PlexMediaServer/hass/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-45z8bzr6/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp59_mmtqmpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-i686-3.5
creating build/lib.linux-i686-3.5/psutil
copying psutil/_psposix.py -> build/lib.linux-i686-3.5/psutil
copying psutil/__init__.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pswindows.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_common.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pslinux.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_psosx.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_compat.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_psbsd.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pssunos.py -> build/lib.linux-i686-3.5/psutil
creating build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-i686-3.5/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-i686-3.5
creating build/temp.linux-i686-3.5/psutil
i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=531 -DPSUTIL_LINUX=1 -I/usr/include/python3.5m -I/PlexMediaServer/hass/include/python3.5m -c psutil/_psutil_common.c -o build/temp.linux-i686-3.5/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil
Running setup.py install for psutil ... error
Complete output from command /PlexMediaServer/hass/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-45z8bzr6/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-r3gpqlml-record/install-record.txt --single-version-externally-managed --compile --install-headers /PlexMediaServer/hass/include/site/python3.5/psutil:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-3.5
creating build/lib.linux-i686-3.5/psutil
copying psutil/_psposix.py -> build/lib.linux-i686-3.5/psutil
copying psutil/__init__.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pswindows.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_common.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pslinux.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_psosx.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_compat.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_psbsd.py -> build/lib.linux-i686-3.5/psutil
copying psutil/_pssunos.py -> build/lib.linux-i686-3.5/psutil
creating build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-i686-3.5/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-i686-3.5/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-i686-3.5
creating build/temp.linux-i686-3.5/psutil
i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=531 -DPSUTIL_LINUX=1 -I/usr/include/python3.5m -I/PlexMediaServer/hass/include/python3.5m -c psutil/_psutil_common.c -o build/temp.linux-i686-3.5/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/PlexMediaServer/hass/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-45z8bzr6/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-r3gpqlml-record/install-record.txt --single-version-externally-managed --compile --install-headers /PlexMediaServer/hass/include/site/python3.5/psutil" failed with error code 1 in /tmp/pip-build-45z8bzr6/psutil/
ํธ์ง : ๋ฐฉ๊ธ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์น ํ python 3.4.3์์ ์ ๋ฐ์ดํธํ์ต๋๋ค.
๋์๊ฒ ๊ฐ์ ๋ฌธ์ :
bob<strong i="6">@hithere</strong>:~$ python3.6 -m pip install psutil
Collecting psutil
Using cached psutil-5.3.1.tar.gz
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z2l0ojsu/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp0fnfdklipip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
creating build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=531 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil
Running setup.py install for psutil ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z2l0ojsu/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-bvrqh87n-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
creating build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=531 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-z2l0ojsu/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-bvrqh87n-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-z2l0ojsu/psutil/
์ฌ๋ฌ๋ถ์ ํ์ด์ฌ ํค๋ ํ์ผ์ด ํ์ํฉ๋๋ค. Ubuntu : sudo apt-get install python-dev
.
๋ฐฐํฌํ๊ณผ ๊ฐ์ RedHat์์๋ sudo yum install python-devel
์ด์ด์ผํฉ๋๋ค.
์ค์น ํ์ผ์ ์ฝ์ ํ https://github.com/giampaolo/psutil/blob/master/INSTALL.rst
๊ทธ๋ฌ๋ ์ฌ๋ฌ ๋ฒ์ ์ด ์ค์น๋์ด์๋ ๊ฒฝ์ฐ (์ : python 3.4.3 ๋ฐ 3.5.4๊ฐ ์ค์น๋์ด ์์) ๋ค์๊ณผ ๊ฐ์ด๋ณด๋ค ์ธ๋ถ์ ์ธ ๋ฒ์ ์ ์ง์ ํด์ผํฉ๋๋ค. sudo apt-get install python3.5-dev
๊ทธ ํ ๋ฌธ์ ์์ด ์ค์น๋์์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค!
@Tommatheussen ์ ๋ฅผ ์ํด ์ผ ํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
์ด ๋ฌธ์ ๋ฅผ ๊ฐ์ง ๋ค๋ฅธ ์ฌ๋๋ค์๊ฒ ์ ์ฉ ํ ์์๋ ๋ ํ๋์ ์ฐธ๊ณ :
RedHat ๋ฐฐํฌํ๊ณผ Python 2.7์ ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ sudo yum install python-devel
๋ก ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ง ์์์ต๋๋ค. ๋๋ ๊ฒฐ๊ตญ ๊ทธ๊ฒ์ด ์ด๋ค ์ด์ ๋ก ํ์ด์ฌ 2.6 ์ฉ python-devel์ ์ค์นํ๊ธฐ ๋๋ฌธ์ด๋ผ๋ ๊ฒ์ ๊นจ๋ฌ์์ต๋๋ค.
์ฝ๊ฐ์ ์ธํฐ๋ท ๊ฒ์์ ํ ํ sudo yum install python27-devel.x86_64
ํ์ฌ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์์์์ต๋๋ค.์ด ๋ฌธ์ ๋ Python 2.7 ์ฉ python_devel์ ์ค์น ํ ํ pip install psutil
์ฑ๊ณตํ์ต๋๋ค.
์ฐ๋ถํฌ 16.04 ๋ด๊ฐ ๋์๋ค
sudo apt install python3.6-dev
python3 -m pip install psutil
์ฌ๋ฌ๋ถ์ ํ์ด์ฌ ํค๋ ํ์ผ์ด ํ์ํฉ๋๋ค. Ubuntu :
sudo apt-get install python-dev
.
๋ฐฐํฌํ๊ณผ ๊ฐ์ RedHat์์๋sudo yum install python-devel
์ด์ด์ผํฉ๋๋ค.
์๋ํ ์ธ๋ฌผ. ๊ฐ์ฌํฉ๋๋ค !
sudo yum install python-devel
๋ python 3์ ์ฌ์ฉํ๋ ๋์ ์๋ํ์ง ์์ผ๋ฏ๋ก python 3 .. ์คํ์ค์ธ ๊ฒฝ์ฐ sudo yum install python3-devel
incase๋ฅผ ์ฌ์ฉํด๋ณด์ธ์. ๋ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. :)
@Kosemii tensorflow ๋ฐ์ดํฐ ์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค์นํ๊ธฐ ์ํด tfds-nightly๋ฅผ ์ค์นํ๋ ค๊ณ ํ ๋์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์ด๊ฒ์ ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
sudo apt-get install python3.5-dev
3.6์์ ์์
ํ๋ ๊ฒฝ์ฐ 3.5๋ฅผ 3.6์ผ๋ก ๋ฐ๊ฟ๋๋ค.
๊ฐ์ ํ๊ฒฝ์ ์ฌ์ฉํ์ฌ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ sudo apt-get install python3.5-dev
์ (๋ฅผ) ์ฒ์์๋ ํด๊ฒฐํ์ง ๋ชปํ์ต๋๋ค.
์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ค์๊ณผ ๊ฐ์ดํด์ผํ์ต๋๋ค.
deactivate
virtualenvsudo apt-get install python3.5-dev
์๋ ,
๋์์ ์ฃผ์ ์ ๊ฐ์ฌํ์ง๋ง์ด ๋ฌธ์ ๋ 1 ๋ ๋์ ํด๊ฒฐ๋์์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ๋ณธ์ง์ ์ผ๋ก ์ค๋ณต ๋๊ธ์ด ๊ฒ์๋๊ณ ์์ต๋๋ค.
๊ณผ ํฌ๊ฒ ๋ค๋ฅธ ๊ฒฝ์ฐ๊ฐ ์๋๋ฉด ๊ฒ์ํ์ง ๋ง์ญ์์ค.
์ด์ ๋๊ธ.
๊ฐ์ฌ
2019 ๋
5 ์ 14 ์ผ ํ์์ผ 16:07 Vincent Houlbrรจque, [email protected]
์ผ๋ค :
๊ฐ์ ํ๊ฒฝ์ ์ฌ์ฉํ์ฌ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ sudo apt-get ์ํ
python3.5-dev๋ฅผ ์ค์นํด๋ ์ฒ์์๋ ํด๊ฒฐ๋์ง ์์์ต๋๋ค.์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ค์๊ณผ ๊ฐ์ดํด์ผํ์ต๋๋ค.
- virtualenv ๋นํ์ฑํ
- virtualenv ์ ๊ฑฐ
- sudo apt-get install python3.5-dev
- virtualenv๋ฅผ ๋ค์ ์์ฑํ์ญ์์ค.
โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/giampaolo/psutil/issues/1143?email_source=notifications&email_token=AFO6NBFVCTDJADDS3DNLQCTPVLIUNA5CNFSM4D5YZULKYY3PNVWWK3TUL52HS4DFWSVREXG43VMVORBW63LNMVW278624PYATDNMVXWZLOBW63LNMVXHJK
๋๋ ์ค๋ ๋ ์์๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AFO6NBHS7V2W36IPJ3FI64TPVLIUNANCNFSM4D5YZULA
.
sudo yum install python-devel
๋ python 3์ ์ฌ์ฉํ๋ ๋์ ์๋ํ์ง ์์ผ๋ฏ๋ก python 3 .. ์คํ์ค์ธ ๊ฒฝ์ฐsudo yum install python3-devel
incase๋ฅผ ์ฌ์ฉํด๋ณด์ธ์. ๋ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. :)
๊ฐ์ฌํฉ๋๋ค.
sudo yum install python-devel
๋ python 3์ ์ฌ์ฉํ๋ ๋์ ์๋ํ์ง ์์ผ๋ฏ๋ก python 3 .. ์คํ์ค์ธ ๊ฒฝ์ฐsudo yum install python3-devel
incase๋ฅผ ์ฌ์ฉํด๋ณด์ธ์. ๋ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. :)
๊ฐ์ฌํฉ๋๋ค.
yum install python2-devel
๋๋ yum install python3-devel
19.12.2019-05.01.2020 ์ฌ์ด์ ํด๊ฐ๋ฅผ ๋ ๋ ๊ฒ์ ๋๋ค.
๊ธด๊ธ ์ํฉ์ ๊ฒฝ์ฐ 0756.932.293์ผ๋ก ์ ์๊ฒ ์ฐ๋ฝ ํ ์ ์์ต๋๋ค.
ํ๋ณตํ ์ถํ!
์๋ ์ค ๊ฐ๊ฒ ์
ํค๋ ํ์ผ์ ์ค์นํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
virtualenv์ ์ค์นํ๋ ค๊ณ ํ ๋ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ฌ ๋นํฉํ์ต๋๋ค.
# pip install psutil
Collecting psutil
Downloading <CENSORED>/psutil-5.7.0.tar.gz (449kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 450kB 52.5MB/s
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
...
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python36/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/opt/rh/rh-python36/root/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/opt/my-envs/custom-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-gv49hqf0/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-4oyv7j_1-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/my-envs/custom-venv/include/site/python3.6/psutil" failed with error code 1 in /tmp/pip-build-gv49hqf0/psutil/
ํ๊ฒฝ:
CentOS 7.7
python3-devel-3.6.8
ํ์ด์ฌ 3.6.8
pip3 9.0.3
virtualenv ๋ช
๋ น์ด python2 ๊ตฌ์กฐ๋ก ๋ฐํ์ก์ต๋๋ค. Ansible Tower ๋ฌธ์๋ ๊ถ์ฅ ์ฌํญ์ด ์๋ชป๋์์ต๋๋ค.
https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html
sudo virtualenv -p /opt/rh/rh-python36/root/usr/bin/python3 /opt/my-envs/custom-venv
source /opt/my-envs/custom-venv/bin/activate
sudo /opt/my-envs/custom-venv/bin/pip install psutil
๋์ ๋ค์์ ์ํํ์ญ์์ค.
sudo python3 -m venv /opt/my-envs/custom-venv
source /opt/my-envs/custom-venv/bin/activate
sudo /opt/my-envs/custom-venv/bin/pip install psutil
์ฐ๋ถํฌ 16.04 ๋ด๊ฐ ๋์๋ค
sudo apt install python3.6-dev python3 -m pip install psutil
thx ๋จ์, ์ ๋ง ๋์์ฃผ์ธ์!
์ฌ๋ฌ๋ถ์ ํ์ด์ฌ ํค๋ ํ์ผ์ด ํ์ํฉ๋๋ค. Ubuntu :
sudo apt-get install python-dev
.
๋ฐฐํฌํ๊ณผ ๊ฐ์ RedHat์์๋sudo yum install python-devel
์ด์ด์ผํฉ๋๋ค.
๋๋จํ ๊ฐ์ฌํฉ๋๋ค. ๊ทธ๊ฒ์ ๋๋ฅผ ์ฌ๊ฒผ๋ค
์ฌ์ ํ์ด ๋ฌธ์ ๊ฐ ์์ผ๋ฉด ์๋ฒ์ gcc ๋ฅผ ์ค์นํ์ญ์์ค.
exec pip3 install lmdb๋ฅผ ์๋ํ๋ฉด yum install python3-devel์ ์๋ ํ ์ ์์ต๋๋ค.
์ค์น ํ์ผ์ ์ฝ์ ํ https://github.com/giampaolo/psutil/blob/master/INSTALL.rst
๊ทธ๋ฌ๋ ์ฌ๋ฌ ๋ฒ์ ์ด ์ค์น๋์ด์๋ ๊ฒฝ์ฐ (์ : python 3.4.3 ๋ฐ 3.5.4๊ฐ ์ค์น๋์ด ์์) ๋ค์๊ณผ ๊ฐ์ด๋ณด๋ค ์ธ๋ถ์ ์ธ ๋ฒ์ ์ ์ง์ ํด์ผํฉ๋๋ค.sudo apt-get install python3.5-dev
๊ทธ ํ ๋ฌธ์ ์์ด ์ค์น๋์์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค. ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. :)
OS : CentOS Linux ๋ฆด๋ฆฌ์ค 8.0.1905 (์ฝ์ด)
ํ์ด์ฌ : 3.6
๋จ์ : SystemExit: error: command 'gcc' failed with exit status 1
๋ฌธ์ ํด๊ฒฐ๋จ.
ym install -y gcc gcc-c++ libgcc platform-python-devel
์ด ๋ฌธ์ ๋ฅผ ๊ฐ์ง ๋ค๋ฅธ ์ฌ๋๋ค์๊ฒ ์ ์ฉ ํ ์์๋ ๋ ํ๋์ ์ฐธ๊ณ :
RedHat ๋ฐฐํฌํ๊ณผ Python 2.7์ ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ
sudo yum install python-devel
๋ก ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ง ์์์ต๋๋ค. ๋๋ ๊ฒฐ๊ตญ ๊ทธ๊ฒ์ด ์ด๋ค ์ด์ ๋ก ํ์ด์ฌ 2.6 ์ฉ python-devel์ ์ค์นํ๊ธฐ ๋๋ฌธ์ด๋ผ๋ ๊ฒ์ ๊นจ๋ฌ์์ต๋๋ค.์ฝ๊ฐ์ ์ธํฐ๋ท ๊ฒ์์ ํ ํ
sudo yum install python27-devel.x86_64
ํ์ฌ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์์์์ต๋๋ค.์ด ๋ฌธ์ ๋ Python 2.7 ์ฉ python_devel์ ์ค์น ํ ํpip install psutil
์ฑ๊ณตํ์ต๋๋ค.
Python 3 ์ด์ :
sudo yum install python3-devel.x86_64
Windows 10์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.์ด ๋ฌธ์ ๋ฅผ ์ด๋ป๊ฒ ํด๊ฒฐํ ์ ์์ต๋๊น?
์ด์ ๋๊ธ, ํนํ https://github.com/giampaolo/psutil/issues/1143#issuecomment -334694641์ ์ดํด๋ณด์ธ์. Windows์์๋ pip
๊ฐ tarball ๋์ wheels / binaries๋ฅผ ๊ฐ์ ธ ์ค๋ฏ๋ก ๊ทธ๋ ๊ฒ ํ ํ์๊ฐ ์์ต๋๋ค. ์ด๋ฏธ ํด๊ฒฐ์ฑ
์ด ์๊ณ ๋๊ธ์ด ๋๋ฌด ๋ง๊ธฐ ๋๋ฌธ์์ด ๋ํ๋ฅผ ์ ๊ทธ๊ฒ ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ค์น ํ์ผ์ ์ฝ์ ํ https://github.com/giampaolo/psutil/blob/master/INSTALL.rst
๊ทธ๋ฌ๋ ์ฌ๋ฌ ๋ฒ์ ์ด ์ค์น๋์ด์๋ ๊ฒฝ์ฐ (์ : python 3.4.3 ๋ฐ 3.5.4๊ฐ ์ค์น๋์ด ์์) ๋ค์๊ณผ ๊ฐ์ด๋ณด๋ค ์ธ๋ถ์ ์ธ ๋ฒ์ ์ ์ง์ ํด์ผํฉ๋๋ค.
sudo apt-get install python3.5-dev
๊ทธ ํ ๋ฌธ์ ์์ด ์ค์น๋์์ต๋๋ค.