๋ฌ๋ฆด ๋
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
์๋ง๋ ?)๋ฅผ ์ค์นํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
BTW, ์ด๊ฒ์ IPython ๋ฌธ์ ๊ฐ ์๋๊ธฐ ๋๋ฌธ์ ๋ซ์ต๋๋ค. ํ์ง๋ง ๊ณ์ ์ง๋ฌธํ๊ฑฐ๋ ๋๊ธ์ ๋จ๊ฒจ์ฃผ์ธ์.
ur ์๋ฃจ์ ์ thnx์์ ์๋ํ์ต๋๋ค.
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
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 ์ค์น์ ๋์์ด ๋์์ต๋๋ค. :)
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ทธ๊ฒ์ IPython๊ณผ ๊ด๋ จ์ด ์์ผ๋ฉฐ scandir ์ค์น์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. scandir ์ ์ง ๊ด๋ฆฌ์๋ฅผ ํตํด ์ด๋ฅผ ํ์ธํด์ผ ํฉ๋๋ค.
์ปดํ์ผํ๋ ๋์ Python.h๊ฐ ๋๋ฝ๋ ๊ฒฝ์ฐ Python ํค๋๊ฐ ๋๋ฝ๋์๊ธฐ ๋๋ฌธ์ผ ์ ์์ต๋๋ค. c-extensions(scandir์ ์ค์นํ์ฌ ์์์ ์ผ๋ก ์ํ)๋ฅผ ์ปดํ์ผํ๋ ค๋ ๊ฒฝ์ฐ Python ํค๋(
apt-get install python-dev
์๋ง๋ ?)๋ฅผ ์ค์นํ๋ ๊ฒ์ด ์ข์ต๋๋ค.