<p>psutil์ด python3.6 ๋ฐ Ubuntu16.04์— ์„ค์น˜๋˜์ง€ ์•Š์Œ</p>

์— ๋งŒ๋“  2017๋…„ 10์›” 04์ผ  ยท  30์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: giampaolo/psutil

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/

bug linux

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์„ค์น˜ ํŒŒ์ผ์„ ์ฝ์€ ํ›„ https://github.com/giampaolo/psutil/blob/master/INSTALL.rst
๊ทธ๋Ÿฌ๋‚˜ ์—ฌ๋Ÿฌ ๋ฒ„์ „์ด ์„ค์น˜๋˜์–ด์žˆ๋Š” ๊ฒฝ์šฐ (์˜ˆ : python 3.4.3 ๋ฐ 3.5.4๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์Œ) ๋‹ค์Œ๊ณผ ๊ฐ™์ด๋ณด๋‹ค ์„ธ๋ถ€์ ์ธ ๋ฒ„์ „์„ ์ง€์ •ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. sudo apt-get install python3.5-dev
๊ทธ ํ›„ ๋ฌธ์ œ์—†์ด ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋ชจ๋“  30 ๋Œ“๊ธ€

์—ฌ๊ธฐ์— 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 virtualenv
  • virtualenv ์ œ๊ฑฐ
  • sudo apt-get install python3.5-dev
  • virtualenv๋ฅผ ๋‹ค์‹œ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค.

์•ˆ๋…•,

๋„์›€์„ ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•˜์ง€๋งŒ์ด ๋ฌธ์ œ๋Š” 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๋ฅผ ๊ฐ€์ ธ ์˜ค๋ฏ€๋กœ ๊ทธ๋ ‡๊ฒŒ ํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ์ด๋ฏธ ํ•ด๊ฒฐ์ฑ…์ด ์žˆ๊ณ  ๋Œ“๊ธ€์ด ๋„ˆ๋ฌด ๋งŽ๊ธฐ ๋•Œ๋ฌธ์—์ด ๋Œ€ํ™”๋ฅผ ์ž ๊ทธ๊ฒ ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰

๊ด€๋ จ ๋ฌธ์ œ

gozdal picture gozdal  ยท  11์ฝ”๋ฉ˜ํŠธ

wemakeweb picture wemakeweb  ยท  3์ฝ”๋ฉ˜ํŠธ

ntouran picture ntouran  ยท  4์ฝ”๋ฉ˜ํŠธ

ssbarnea picture ssbarnea  ยท  9์ฝ”๋ฉ˜ํŠธ

tbrownaw picture tbrownaw  ยท  5์ฝ”๋ฉ˜ํŠธ