Ipython: ํ• ์„ค์น˜ ์˜ค๋ฅ˜

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

๋‹ฌ๋ฆด ๋•Œ

pip install ipython

๋‚˜๋Š” ์–ป๋‹ค

Collecting ipython
  Using cached ipython-5.3.0-py2-none-any.whl
Collecting pickleshare (from ipython)
  Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython)
Collecting traitlets>=4.2 (from ipython)
  Using cached traitlets-4.3.2-py2.py3-none-any.whl
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython)
  Using cached backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting decorator (from ipython)
  Using cached decorator-4.0.11-py2.py3-none-any.whl
Collecting pygments (from ipython)
  Using cached Pygments-2.2.0-py2.py3-none-any.whl
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python2.7/dist-packages (from ipython)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython)
  Using cached pathlib2-2.2.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages (from ipython)
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython)
  Using cached prompt_toolkit-1.0.14-py2-none-any.whl
Requirement already satisfied: enum34; python_version == "2.7" in /usr/lib/python2.7/dist-packages (from traitlets>=4.2->ipython)
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from traitlets>=4.2->ipython)
Collecting ipython-genutils (from traitlets>=4.2->ipython)
  Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
  Using cached scandir-1.5.tar.gz
Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools>=18.5->ipython)
Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools>=18.5->ipython)
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.4->ipython)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging>=16.8->setuptools>=18.5->ipython)
Building wheels for collected packages: scandir
  Running setup.py bdist_wheel for scandir ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mGtqyq/scandir/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/tmpzPzH0bpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying scandir.py -> build/lib.linux-x86_64-2.7
  running build_ext
  building '_scandir' extension
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
  _scandir.c:14:20: fatal error: Python.h: No such file or directory
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for scandir
  Running setup.py clean for scandir
Failed to build scandir
Installing collected packages: scandir, pathlib2, pickleshare, simplegeneric, decorator, ipython-genutils, traitlets, backports.shutil-get-terminal-size, pygments, wcwidth, prompt-toolkit, ipython
  Running setup.py install for scandir ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mGtqyq/scandir/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-kVFdnD-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying scandir.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_scandir' extension
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
    _scandir.c:14:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mGtqyq/scandir/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-kVFdnD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-mGtqyq/scandir/

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

๊ทธ๊ฒƒ์€ IPython๊ณผ ๊ด€๋ จ์ด ์—†์œผ๋ฉฐ scandir ์„ค์น˜์—์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. scandir ์œ ์ง€ ๊ด€๋ฆฌ์ž๋ฅผ ํ†ตํ•ด ์ด๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ปดํŒŒ์ผํ•˜๋Š” ๋™์•ˆ Python.h๊ฐ€ ๋ˆ„๋ฝ๋œ ๊ฒฝ์šฐ Python ํ—ค๋”๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. c-extensions(scandir์— ์„ค์น˜ํ•˜์—ฌ ์•”์‹œ์ ์œผ๋กœ ์ˆ˜ํ–‰)๋ฅผ ์ปดํŒŒ์ผํ•˜๋ ค๋Š” ๊ฒฝ์šฐ Python ํ—ค๋”( apt-get install python-dev ์•„๋งˆ๋„ ?)๋ฅผ ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

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

๊ทธ๊ฒƒ์€ IPython๊ณผ ๊ด€๋ จ์ด ์—†์œผ๋ฉฐ scandir ์„ค์น˜์—์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. scandir ์œ ์ง€ ๊ด€๋ฆฌ์ž๋ฅผ ํ†ตํ•ด ์ด๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ปดํŒŒ์ผํ•˜๋Š” ๋™์•ˆ Python.h๊ฐ€ ๋ˆ„๋ฝ๋œ ๊ฒฝ์šฐ Python ํ—ค๋”๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. c-extensions(scandir์— ์„ค์น˜ํ•˜์—ฌ ์•”์‹œ์ ์œผ๋กœ ์ˆ˜ํ–‰)๋ฅผ ์ปดํŒŒ์ผํ•˜๋ ค๋Š” ๊ฒฝ์šฐ Python ํ—ค๋”( apt-get install python-dev ์•„๋งˆ๋„ ?)๋ฅผ ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

BTW, ์ด๊ฒƒ์€ IPython ๋ฌธ์ œ๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‹ซ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๊ณ„์† ์งˆ๋ฌธํ•˜๊ฑฐ๋‚˜ ๋Œ“๊ธ€์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”.

ur ์†”๋ฃจ์…˜์€ thnx์—์„œ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค.

  • ์ด ์ด๋ฉ”์ผ์€ 100% ์žฌํ™œ์šฉ๋œ ์ „์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ๋žŒ๋„ ๋™๋ฌผ๋„ ์—†๋‹ค
    ์ด ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ถ€์ƒ์„ ์ž…๊ฑฐ๋‚˜ ์™ธ์ƒ์„ ์ž…์—ˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค
    ๋ฐ›๋Š” ์‚ฌ๋žŒ์—๊ฒŒ ๋™์ผํ•˜๊ฒŒ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.*

2017๋…„ 4์›” 14์ผ (๊ธˆ) ์˜คํ›„ 1์‹œ 11๋ถ„, Matthias Bussonnier <
[email protected]>์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ผ์Šต๋‹ˆ๋‹ค.

BTW, ์ด๊ฒƒ์€ IPython ๋ฌธ์ œ๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‹ซ์ง€๋งŒ ์ž์œ ๋กญ๊ฒŒ ์œ ์ง€ํ•˜์‹ญ์‹œ์˜ค.
์งˆ๋ฌธ์„ ํ•˜๊ฑฐ๋‚˜ ๋Œ“๊ธ€์„ ๋‚จ๊น๋‹ˆ๋‹ค.

โ€”
์Šค๋ ˆ๋“œ๋ฅผ ์ž‘์„ฑํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/ipython/ipython/issues/10454#issuecomment-294193464 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AP0A5HJjJ3e9DRWaJEPUe_8PakiWUET9ks5rv6imgaJpZM4M96VS
.

์ ์ ˆํ•œ ์„ค์น˜ python-dev

  • ์ด ์ด๋ฉ”์ผ์€ 100% ์žฌํ™œ์šฉ๋œ ์ „์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ๋žŒ๋„ ๋™๋ฌผ๋„ ์—†๋‹ค
    ์ด ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ถ€์ƒ์„ ์ž…๊ฑฐ๋‚˜ ์™ธ์ƒ์„ ์ž…์—ˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค
    ๋ฐ›๋Š” ์‚ฌ๋žŒ์—๊ฒŒ ๋™์ผํ•˜๊ฒŒ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.*

2017๋…„ 4์›” 14์ผ ๊ธˆ์š”์ผ ์˜คํ›„ 1์‹œ 25๋ถ„, Furlong, Jonathan <
[email protected]> ์“ด:

ur ์†”๋ฃจ์…˜์€ thnx์—์„œ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค.

  • ์ด ์ด๋ฉ”์ผ์€ 100% ์žฌํ™œ์šฉ๋œ ์ „์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ๋žŒ๋„ ๋™๋ฌผ๋„ ์—†๋‹ค
    ์ด ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ถ€์ƒ์„ ์ž…๊ฑฐ๋‚˜ ์™ธ์ƒ์„ ์ž…์—ˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค
    ๋ฐ›๋Š” ์‚ฌ๋žŒ์—๊ฒŒ ๋™์ผํ•˜๊ฒŒ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.*

2017๋…„ 4์›” 14์ผ(๊ธˆ) ์˜คํ›„ 1์‹œ 11๋ถ„, Matthias Bussonnier <
[email protected]>์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ผ์Šต๋‹ˆ๋‹ค.

BTW, ์ด๊ฒƒ์€ IPython ๋ฌธ์ œ๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‹ซ์ง€๋งŒ ์ž์œ ๋กญ๊ฒŒ ์œ ์ง€ํ•˜์‹ญ์‹œ์˜ค.
์งˆ๋ฌธ์„ ํ•˜๊ฑฐ๋‚˜ ๋Œ“๊ธ€์„ ๋‚จ๊น๋‹ˆ๋‹ค.

โ€”
์Šค๋ ˆ๋“œ๋ฅผ ์ž‘์„ฑํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/ipython/ipython/issues/10454#issuecomment-294193464 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AP0A5HJjJ3e9DRWaJEPUe_8PakiWUET9ks5rv6imgaJpZM4M96VS
.

CentOS ์‚ฌ์šฉ์ž์˜ ๊ฒฝ์šฐ 'yum groupinstall 'development tool''์„ ์ˆ˜ํ–‰ํ–ˆ๊ณ  ipython์„ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค(python-devel ์„ค์น˜๋งŒ ํ•ด๋„ ์ž‘๋™ํ•˜์ง€ ์•Š์Œ). ํ•˜์ง€๋งŒ Carreau๊ฐ€ ์–ธ๊ธ‰ํ•œ ๋Œ€๋กœ c-extensions๋งŒ ๊ณ ๋ คํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

Windows์—์„œ "pip install jupyter"๋Š” scandir์„ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ "pip install scandir"์€ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  "pip install jupyter"๊ฐ€ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.

Windows์—์„œ "pip install jupyter"๋Š” scandir์„ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ "pip install scandir"์€ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  "pip install jupyter"๊ฐ€ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด์ƒํ•ฉ๋‹ˆ๋‹ค. pip ๋ฐ setuptools ๋ฒ„์ „์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

ํ™•์‹คํ•œ ๊ฒƒ! ๋Šฆ์–ด์„œ ๋ฏธ์•ˆํ•ฉ๋‹ˆ๋‹ค.
ํ• v9.0.1
์„ค์ • ๋„๊ตฌ v28.8.0

์„ฑ๊ณต์ ์ธ jupyter ์„ค์น˜๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— pip๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง์ ‘ scandir ์™ธ์— ๋‹ค๋ฅธ ๋ชจ๋“  ์ข…์†์„ฑ์„ ์„ค์น˜ํ–ˆ์Œ์„ ๋ถ„๋ช…ํžˆ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋˜ํ•œ ์™„์„ฑ๋„๋ฅผ ์œ„ํ•ด

python v2.7.13:a06454b1afa1, 2016๋…„ 12์›” 17์ผ, 20:53:40, MSC v.1500 64๋น„ํŠธ(AMD64)
Windows 10, ๋ฒ„์ „ 1703(OS ๋นŒ๋“œ 15063.540)

Python 2.7์ด ์„ค์น˜๋œ Red Hat Enterprise Linux Server ๋ฆด๋ฆฌ์Šค 7.4(Maipo)์—์„œ ์ด์™€ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.
ipython์„ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ•˜๋Š”๋ฐ scandir ๋•Œ๋ฌธ์— ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
๋‚˜๋Š” ํ•ด๊ฒฐ์ฑ…์„ ์ฐพ์ง€ ๋ชปํ–ˆ๊ณ  "scandir"์„ ๊ฒ€์ƒ‰ํ•˜๋ฉด ์ด ๋ฌธ์ œ๊ฐ€ ๊ฒฐ๊ณผ ๋ชฉ๋ก์˜ ์ƒ์œ„์— ๋†“์ด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋ˆ„๊ตฐ๊ฐ€ RHEL์— scandir์„ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ง€์นจ์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

sudo pip install scandir ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ๋™์ผํ•œ ์˜ค๋ฅ˜๊ฐ€ ๊ณ„์† ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

  _scandir.c:14:20: fatal error: Python.h: No such file or directory
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1

PATH ๋ณ€์ˆ˜ ๋ฌธ์ œ์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ•˜๊ณ  ์‹ถ์„ ์ˆ˜๋„
"Python.h๋Š” ์–ด๋””์— ์žˆ์Šต๋‹ˆ๊นŒ?"
ํ•˜๋‚˜ ์ด์ƒ์˜ ๊ฒฝ๋กœ๊ฐ€ ๋‚˜ํƒ€๋‚˜๋ฉด PATH ๋ณ€์ˆ˜์— ๋””๋ ‰ํ† ๋ฆฌ(ํŒŒ์ผ ์ด๋ฆ„ ์ œ์™ธ)๋ฅผ ์ถ”๊ฐ€ํ•˜์‹ญ์‹œ์˜ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋” ํฐ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ณ  ์‹œ์Šคํ…œ์—์„œ ํ—ค๋” ํŒŒ์ผ์„ ๊ฐ€์ ธ์˜ค๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋น ๋ฅธ ์‘๋‹ต์— ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๋ง์„ ๋งŽ์ด ํ•ด์„œ ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค.
๋”ฐ๋ผ์„œ whereis Python.h ๋ฐ whereis 'Python.h' ๋Š” ์ „ํ˜€ ํ‘œ์‹œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ๋‚ด๊ฐ€ ์ฒ˜์Œ ์•ก์„ธ์Šคํ•  ๋•Œ Python 2.7๋กœ๋งŒ ์„ค์ •๋œ ์›๊ฒฉ ์‹œ์Šคํ…œ์ž…๋‹ˆ๋‹ค.
gcc๋„ ์—†์–ด์„œ sudo yum groupinstall 'development tool' _afterwards._ ์‹คํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ด๊ฒƒ์ด ๋ฌธ์ œ๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ๊ทธ๋ ‡๋‹ค๋ฉด Python์„ ์ œ๊ฑฐํ•˜๊ณ  ๋‹ค์‹œ ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๊นŒ?

์œ„์˜ ์‚ฌํ•ญ์ด ์ค‘์š”ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ:
์ €๋Š” sudo ์‚ฌ์šฉ์ž์ด์ง€๋งŒ ๋ฃจํŠธ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ ์›ํ•˜๋Š” ํŒŒ์ผ์„ ๋Œ€๋ถ€๋ถ„์˜ ์žฅ์†Œ์— scp ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋‚˜๋Š” ๋ฌด์—‡์„ ๋ณต์‚ฌํ• ์ง€(์ผ๋ถ€ C ํ—ค๋” ํŒŒ์ผ Python.h?), ๋ณต์‚ฌํ•  ์œ„์น˜์™€ ๋ฌด์—‡์„ ํ•ด์•ผ ํ•˜๋Š”์ง€(gcc์˜ ํฌํ•จ ๊ฒฝ๋กœ์— ๋ฌด์–ธ๊ฐ€๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์ด ๋งž์Šต๋‹ˆ๊นŒ? ๊ทธ๋Ÿฌ๋‚˜ ํ•ด๋‹น gcc ๋ช…๋ น์ด ์‹คํ–‰๋˜๋Š” ์œ„์น˜๋Š” ์–ด๋””์ธ์ง€) ? ๋ชจ๋ฅด๊ฒ ์–ด์š”.

yum (yuck) ๋ฐ rpm ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐ ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด ๋ถˆํ–‰ํžˆ๋„ apt-get ๋‚ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
๋ฌธ์„œ์— ๋”ฐ๋ฅด๋ฉด Python 2.7 ์—์„œ ipython ๋ฒ„์ „ 5 ๋ฐ scandir ๋ฒ„์ „ < 1.6์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํƒ€์‚ฌ API ์ œ์•ฝ์œผ๋กœ ์ธํ•ด Python 3.x๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์ €๋Š” ์ˆ™๋ จ๋œ ๊ฐœ๋ฐœ์ž(RHEL์„ ์ œ์™ธํ•œ ๋ชจ๋“  ๊ฒƒ)์ด๋ฏ€๋กœ ์ˆ˜๋™ ์„ค์น˜๊ฐ€ ๋‘๋ ต์ง€ ์•Š์Šต๋‹ˆ๋‹ค.... ์„ค์น˜ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•„๋ฌด ๊ฒƒ๋„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

๋‚ด PATH๋Š” ์ด ์‹œ์Šคํ…œ์ด ๋ฐฉ๊ธˆ ์„ค์ •๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ํ˜„์žฌ ๋งค์šฐ ์งง์Šต๋‹ˆ๋‹ค.
(๋‚ด๊ฐ€ ์š”์ฒญํ•œ๋Œ€๋กœ Python 2.7์ด ์„ค์น˜๋˜์—ˆ์ง€๋งŒ gcc๋„ ์•„๋‹Œ ๋‹ค๋ฅธ ๊ฒƒ์€ ์—†์—ˆ์Šต๋‹ˆ๋‹ค. )

~$ echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

ํŒŒ์ด์ฌ์€ ์—ฌ๊ธฐ์— ์‚ด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค:

$ whereis python
python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz

๊ดœ์ฐฎ์€. ๋‚˜๋Š” ๋‹น์‹ ์„ ์œ„ํ•œ ํ•ด๊ฒฐ์ฑ…์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์•„๋‹ˆ๋ฉด ์ ์–ด๋„ ์‹œ๋„ํ•ด ๋ณผ ๋งŒํ•œ ๊ฒƒ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์žฅํ™ฉํ•œ ๊ฒƒ์— ๋Œ€ํ•ด ์‚ฌ๊ณผํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ƒํ™ฉ์—์„œ๋Š” ์™„์ „ํ•œ ๋ณด๊ณ ๊ฐ€ ๋ฏธ๋•์ž…๋‹ˆ๋‹ค.

sudo yum install python-devel
pip install scandir==1.5

Python ํ—ค๋” ํŒŒ์ผ์„ "/usr/include/python2.7/"์— ์„ค์น˜ํ•˜๊ณ  ํ•„์š”ํ•œ ์ ์ ˆํ•œ scandir ๋ฒ„์ „์„ ๊ฐ€์ ธ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ์˜ค๋ฅ˜๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ ์ฃผ์ €ํ•˜์ง€ ๋ง๊ณ  ๋‹ค์‹œ ๊ฒŒ์‹œํ•˜์‹ญ์‹œ์˜ค!

๋˜ํ•œ ์ด์ „๋ณด๋‹ค ์ž‘์€ ์ˆ˜์ •. ํ—ค๋”๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ์‚ฌ์šฉํ•˜๋ผ๊ณ  ์กฐ์–ธํ–ˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

sudo updatedb
locate Python.h

๊ทธ ๋‹น์‹œ์—๋Š” whereis ๊ฐ€ ์‹คํ–‰ ํŒŒ์ผ, ๋งค๋‰ด์–ผ ํŽ˜์ด์ง€ ๋ฐ ์†Œ์Šค ํŒŒ์ผ๋กœ ์ œํ•œ๋˜์–ด ์žˆ๋‹ค๋Š” ์‚ฌ์‹ค์„ ๋ชฐ๋ž์Šต๋‹ˆ๋‹ค.

์ถ”์‹ : ๋‚ด ์ดˆ๊ธฐ ๊ฒŒ์‹œ๋ฌผ์—์„œ ์‹ค์ˆ˜๋กœ ์ผ๋ถ€ ์ฝ”๋“œ๋ฅผ ์ˆจ๊ฒผ์ง€๋งŒ ์ง€๊ธˆ์€ ๋ณผ ์ˆ˜ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋„์™€ ์ฃผ์‹  @jmchambers90๋‹˜ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

scandir ๋ฌธ์ œ ์ถ”์ ๊ธฐ๋ฅผ ๋ณด๊ณ  ์‹ถ์„ ์ˆ˜๋„ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. https://github.com/benhoyt/scandir/issues/85 RHEL์— ๋Œ€ํ•œ ์–ธ๊ธ‰์ด ์žˆ์œผ๋ฉฐ sudo+pip ์‚ฌ์šฉ์„ ํ”ผํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ œ๋Š” yum ๋ฐ pip๊ฐ€ ํŒŒ์ผ์„ ๋†“๊ณ  ์‹ธ์šธ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

pip 9+๊ฐ€ ์žˆ๋Š” ํ•œ pip๋Š” ์ด์ „ ๋ฒ„์ „์˜ pip๊ฐ€ ์žˆ๊ณ  ์—…๊ทธ๋ ˆ์ด๋“œํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ Python 2์— IPython 6+ ์„ค์น˜๋ฅผ ํ”ผํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. pip install ipython<6 ์„ ์›ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Python.h ์— ๋Œ€ํ•œ ์˜ค๋ฅ˜๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ Python ๊ฐœ๋ฐœ ํ—ค๋”๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์Œ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. Red Hat์—์„œ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๋Š” python-devel ๋˜๋Š” python2-devel ์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค(Debian์—์„œ๋Š” python-dev ). Python 3์—์„œ ๋™์ผํ•œ ์˜ค๋ฅ˜๊ฐ€ ํ‘œ์‹œ๋˜๋Š” ์‚ฌ๋žŒ์ด ์žˆ๋‹ค๋ฉด ํŒจํ‚ค์ง€๋Š” python3-devel ๋˜๋Š” python3-dev ์™€ ๊ฐ™์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

@์นด๋กœ
๋‚˜๋Š” ์ด๋ฏธ ๊ทธ๊ฒƒ์„๋ณด๊ณ  ๊ฑฐ๊ธฐ์— ์งˆ๋ฌธ์„ ๊ฒŒ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์€ ๋‚˜๋ฅผ ์œ„ํ•ด ์ž‘๋™ํ•˜์ง€ ์•Š์•˜๋‹ค.

@jmchambers90
์•„์ด๋””์–ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋‚˜๋Š” ์ด๋ฏธ ๊ทธ๊ฒƒ๋“ค๊ณผ ๋‹ค์–‘ํ•œ ๋ณ€ํ˜•์„ ์‹œ๋„ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ถœ๋ ฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

~$ sudo yum install python-devel
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-optional-rpms                                                                                                                                                             | 3.5 kB  00:00:00
No package python-devel available.
Error: Nothing to do
~$ pip install scandir==1.5
Collecting scandir==1.5
  Using cached scandir-1.5.tar.gz
Building wheels for collected packages: scandir
  Running setup.py bdist_wheel for scandir ... error
  Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VI4qqT/scandir/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/tmpdgntdppip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying scandir.py -> build/lib.linux-x86_64-2.7
  running build_ext
  building '_scandir' extension
  creating build/temp.linux-x86_64-2.7
  gcc -pthread -fno-strict-aliasing -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 -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 -fPIC -I/usr/include/python2.7 -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
  _scandir.c:14:20: fatal error: Python.h: No such file or directory
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for scandir
  Running setup.py clean for scandir
Failed to build scandir
Installing collected packages: scandir
  Running setup.py install for scandir ... error
    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VI4qqT/scandir/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-W_j9CZ-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying scandir.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_scandir' extension
    creating build/temp.linux-x86_64-2.7
    gcc -pthread -fno-strict-aliasing -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 -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 -fPIC -I/usr/include/python2.7 -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
    _scandir.c:14:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VI4qqT/scandir/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-W_j9CZ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-VI4qqT/scandir/



md5-411faa47d16581696ff1f461eadf5851



~$ sudo updatedb
sudo: updatedb: command not found



md5-411faa47d16581696ff1f461eadf5851



~$ locate Python.h
-bash: locate: command not found

๋‚ด Fedora ์‹œ์Šคํ…œ์—์„œ ํŒจํ‚ค์ง€๋Š” ์ด์ œ python2-devel ์ž…๋‹ˆ๋‹ค. RHEL์—์„œ๋Š” ์‹œ๋„ํ•  ์ˆ˜ ์—†์ง€๋งŒ Python.h ๊ฐ€ ํฌํ•จ๋œ ํŒจํ‚ค์ง€๊ฐ€ ์–ด๋”˜๊ฐ€์— ์žˆ์„ ๊ฒƒ์ด๋ผ๊ณ  ํ™•์‹ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์ด ๋ฌด์—‡์ธ์ง€ ํ™•์ธํ•˜๊ณ  ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

@takluyver ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.
๋‚ด ์ƒ๊ฐ์— ์ด ๊ธฐ๊ณ„๋Š” ๋‚˜์‚ฌ๊ฐ€ ๋ฐ•ํ˜€์žˆ์–ด ์ฒญ์†Œํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์•„๋งˆ๋„ ํšŒ์‚ฌ ๋ฐฉํ™”๋ฒฝ๊ณผ ํ”„๋ก์‹œ ๋•Œ๋ฌธ์— pip์™€ yum์€ ๊ฑฐ์˜ ์•Œ์ง€ ๋ชปํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

$ pip install python2-devel
Collecting python2-devel
  Could not find a version that satisfies the requirement python2-devel (from versions: )
No matching distribution found for python2-devel

@takluyver ๋งž์Šต๋‹ˆ๋‹ค. yum์—๋Š” ๊ฑฐ์˜ ํ™•์‹คํžˆ ๊ฐœ๋ฐœ ํŒจํ‚ค์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๋” ๋งŽ์€ ์‹œ๋„๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŒจํ‚ค์ง€ ๊ฒ€์ƒ‰:

sudo ์–Œ ๊ฒ€์ƒ‰ ํŒŒ์ด์ฌ | grep - ๋‚˜๋Š” ๊ฐœ๋ฐœ

๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์€ ๋‹ค์Œ์„ ์„ฑ๊ณต์ ์œผ๋กœ ๋ฐœ๊ฒฌํ–ˆ์Šต๋‹ˆ๋‹ค.

sudo yum install python-devel.x86_64

๋‹ค๋ฅธ ๋ชจ๋“  ๋ฐฉ๋ฒ•์ด ์‹คํŒจํ•˜๋ฉด Python ์†Œ์Šค์—์„œ ํฌํ•จ์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 2.7์˜ ์ตœ์‹  ๋ฒ„์ „์€ ๋‹ค์Œ ์œ„์น˜์— ์žˆ์Šต๋‹ˆ๋‹ค.

https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz

๊ทธ๋ฆฌ๊ณ  Python.h๋Š” ์••์ถ•์„ ํ‘ผ ํŒŒ์ผ์˜ "ํฌํ•จ" ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ @takluyver ๊ฐ€ pip๊ฐ€ ์•„๋‹Œ yum์— ํŒจํ‚ค์ง€ ์„ค์น˜๋ฅผ ์‹œ๋„ํ•  ๊ฒƒ์„ ์ œ์•ˆํ–ˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

sudo yum ์„ค์น˜ python2-devel

์ถ”์ธก์„ ๊ณ„์†ํ•˜๋Š” ๋Œ€์‹  ๋ณด์ด๋Š” ๊ฒƒ์„ ๋ณด๊ธฐ ์œ„ํ•ด RHEL Server 7.4๋ฅผ ์„ค์น˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

yum์— ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋ฃจ๋น„ ๊ฐ™์€ ์ž˜์•Œ๋ ค์ง„๊ฒƒ๋„ ์„ค์น˜๋ชปํ•จ
์ด ๊ธฐ๊ณ„๋Š” ์ž˜๋ชป ๊ตฌ์„ฑ๋˜์–ด ์žˆ์œผ๋ฉฐ ๊ธฐ์ˆ  ์ง€์›๋งŒ์ด ๊ณ ์น  ์ˆ˜ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

์–ด์จŒ๋“  ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋‹น์‹ ์€ ๊ทธ ์ด์ƒ์œผ๋กœ ๋„์›€์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

~$ sudo yum install python2-devel
Loaded plugins: product-id, search-disabled-repos, subscription-manager
No package python2-devel available.
Error: Nothing to do
~$ sudo yum install python-devel.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
No package python-devel.x86_64 available.
Error: Nothing to do
~$ sudo yum search python | grep -i devel
dbus-python-devel.i686 : Libraries and headers for dbus-python
dbus-python-devel.x86_64 : Libraries and headers for dbus-python
gstreamer-python-devel.i686 : Headers for developing programs that will use
gstreamer-python-devel.x86_64 : Headers for developing programs that will use
nautilus-python-devel.x86_64 : Python bindings for Nautilus
nemo-python-devel.x86_64 : Python bindings for Nemo
ovirt-engine-sdk-python.noarch : oVirt Engine Software Development Kit (Python)
python-caja-devel.x86_64 : Python bindings for Caja
python-cherrypy2.noarch : Pythonic, object-oriented web development framework
python-nbxmpp-doc.noarch : Developer documentation for python-nbxmpp
python-pillow-devel.i686 : Development files for python-pillow
python-pillow-devel.x86_64 : Development files for python-pillow
python-pyside-devel.x86_64 : Development files for python-pyside
python-tools.x86_64 : A collection of development tools included with Python
python2-behave.noarch : Tools for the behavior-driven development, Python style
                             : developed at OSRF
python34-cairo-devel.x86_64 : Libraries and headers for python34-cairo
python34-devel.x86_64 : Libraries and header files needed for Python 3
                      : development
python34-gobject-devel.x86_64 : Development files for embedding Python 3.4
python34-greenlet-devel.x86_64 : C development headers for python34-greenlet
wxPython-devel.x86_64 : Development files for wxPython add-on modules
xapian-bindings-python.x86_64 : Files needed for developing Python scripts which
TurboGears.noarch : Back-to-front web development in Python
edk2-tools-python.noarch : EFI Development Kit II Tools
gnome-python2-devel.x86_64 : Development files for building add-on libraries
hawkey-devel.i686 : A Library providing simplified C and Python API to libsolv
hawkey-devel.x86_64 : A Library providing simplified C and Python API to libsolv
kobo.noarch : Python modules for tools development
pygtksourceview-devel.x86_64 : Development files for using pygtksourceview in
pyldb-devel.i686 : Development files for the Python bindings for the LDB library
pyldb-devel.x86_64 : Development files for the Python bindings for the LDB
python-igraph-devel.x86_64 : Development files for igraph
python-pycxx-devel.noarch : PyCXX header and source files
python-strainer.noarch : Tools to allow developers to cleanup web serialization
python-zc-buildout.noarch : System for managing development buildouts
python2-clint.noarch : A set of awesome tools for developing commandline
qscintilla-python-devel.noarch : Development files for QScintilla PyQt4 bindings
redhat-support-lib-python.noarch : Red Hat Support Software Development Library
spyder.noarch : Scientific Python Development Environment

๋‹ค์‹œ ๋งํ•˜์ง€๋งŒ, ๋‹ค๋ฅธ ๋ชจ๋“  ๋ฐฉ๋ฒ•์ด ์‹คํŒจํ•˜๋ฉด yum์„ ์ƒ๋žตํ•˜๊ณ  Python ์†Œ์Šค( https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz )์—์„œ ๋ฐ”๋กœ ํฌํ•จ์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์••์ถ•์„ ํ’€๋ฉด ์••์ถ•์ด ํ’€๋ฆฐ ํŒŒ์ผ์˜ "ํฌํ•จ" ๋””๋ ‰ํ† ๋ฆฌ์—์„œ Python.h๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ‘œ์ค€ ๊ด€ํ–‰์€ ํฌํ•จ์„ /usr/include/python2.7/ ์— ์—ฐ๊ฒฐํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ผ๋‹จ ์ œ์ž๋ฆฌ์— ์žˆ์œผ๋ฉด pip install scandir==1.5 ๋ฅผ ๋‹ค์‹œ ์‹œ๋„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. gcc๊ฐ€ ์—ฌ์ „ํžˆ ํฌํ•จ์„ ์ฐพ์„ ์ˆ˜ ์—†์œผ๋ฉด ์‹œ์Šคํ…œ ๊ฒฝ๋กœ์— /usr/include/python2.7/ ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ scandir ์†Œ์Šค๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  scandir์— ๋Œ€ํ•œ ์„ค์ • ํŒŒ์ผ์—์„œ gcc์— ๋Œ€ํ•œ ํ˜ธ์ถœ์„ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

yum์— python34-devel.x86_64 ๊ฐ€ ์žˆ๊ณ  Python 2.7์— ํ•ด๋‹นํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์€ ์ •๋ง ์ด์ƒํ•ฉ๋‹ˆ๋‹ค.

์ฆ‰๊ฐ์ ์ธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๋ฉด http://mirror.centos.org/centos/7/os/x86_64/Packages/python-devel-2.7.5- ์˜ CentOS ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ์ง์ ‘ Python 2.7 ๊ฐœ๋ฐœ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. scp ์œ„์— ๋†“๊ณ  ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

sudo rpm -ivh python-devel-2.7.5-58.el7.x86_64.rpm

์žฅ๊ธฐ์ ์œผ๋กœ CentOS ์ €์žฅ์†Œ๋ฅผ yum์— ์ถ”๊ฐ€ํ•˜์—ฌ ๊ด€์‹ฌ ์žˆ๋Š” ๋‹ค๋ฅธ yum ํŒจํ‚ค์ง€๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. https://techglimpse.com/configure-yum-rhel-centos-repository/ ๋ฅผ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค.

๋งˆ์ง€๋ง‰์œผ๋กœ RHEL์˜ ์ œ๊ฑฐ๋œ ํŠน์„ฑ์— ๋Œ€ํ•ด ๋ง์”€ํ•˜์‹  ๋‚ด์šฉ์„ ์ดํ•ดํ•ฉ๋‹ˆ๋‹ค. ๋‚˜๋Š” ์ตœ์†Œํ•œ์˜ ์„ค์น˜๋ฅผ ๊ฐ€์ง€๊ณ  ๋†€์•˜๊ณ  ๊ทธ๊ฒƒ์ด ์–ผ๋งˆ๋‚˜ ์ ์€์ง€๋ฅผ ํฌํ•จํ•˜๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์ด ๋†€๋ž์Šต๋‹ˆ๋‹ค. wget , mlocate , python-devel ๋˜๋Š” ruby ์—†์Œ. ๊ทธ๋Ÿฌ๋‚˜ ์ด๋Ÿฌํ•œ ํŒจํ‚ค์ง€ ์ค‘ _all_์€ Packages ๋””๋ ‰ํ† ๋ฆฌ์˜ ์›๋ž˜ ์„ค์น˜ ๋ฏธ๋””์–ด์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. IT ํŒ€์ด ๋„์›€์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค๋ฉด yum์ด ์‹คํŒจํ•  ๋•Œ์—๋„ ํŒจํ‚ค์ง€๋ฅผ ์†Œ์‹ฑํ•  ์‰ฝ๊ณ  ์•ˆ์ •์ ์ธ ์œ„์น˜๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋„๋ก ์„ค์น˜ ๋ฏธ๋””์–ด์—์„œ ์ „์ฒด ํŒจํ‚ค์ง€ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ปดํ“จํ„ฐ๋กœ ๋ณต์‚ฌํ•˜๋„๋ก _๋งค์šฐ_ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ๋˜๋Š” http://mirror.centos.org/centos/7/os/x86_64/Packages ์—์„œ ์ง์ ‘ ์ด๋Ÿฌํ•œ ํŒจํ‚ค์ง€์˜ ์ „๋ถ€๋Š” ์•„๋‹ˆ์ง€๋งŒ ๋Œ€๋ถ€๋ถ„์˜ CentOS ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  rpm ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ™•์‹คํžˆ yum ๋Š” ์ข…์†์„ฑ์„ ์ฒ˜๋ฆฌํ•˜๋ฏ€๋กœ ์ž‘๋™ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ๋” ์ข‹์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋ฅผ ์œ„ํ•ด์„œ๋Š” ์œ„์—์„œ ์ธ์šฉํ•œ ๊ฐ€์ด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ CentOS ์ €์žฅ์†Œ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

@jmchambers90 ํ•ด๋ƒˆ์–ด ! ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค!
์ง€๊ธˆ ์ตœ์†Œ 10์‹œ๊ฐ„ ๋˜๋Š” 11์‹œ๊ฐ„ ๋™์•ˆ ์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

Redhat 7์—์„œ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๊ณ  ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์—…ํ–ˆ์Šต๋‹ˆ๋‹ค.

yum ์„ค์น˜ python-devel.x86_64

@Carreau ์ •๋ง ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!! ๊ท€ํ•˜์˜ ์†”๋ฃจ์…˜์€ Droidbot ์„ค์น˜์— ๋„์›€์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. :)

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