> docker run --tty --interactive --rm python:2.7.12-alpine ash
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.6-150-gf952adf [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
v3.4.6-83-g67e50bc [http://dl-cdn.alpinelinux.org/alpine/v3.4/community]
OK: 5983 distinct packages available
/ # apk add cython g++ musl-dev
(1/21) Upgrading musl (1.1.14-r12 -> 1.1.14-r14)
(2/21) Installing libffi (3.2.1-r2)
(3/21) Installing python (2.7.12-r0)
(4/21) Installing cython (0.24-r1)
(5/21) Installing libgcc (5.3.0-r0)
(6/21) Installing libstdc++ (5.3.0-r0)
(7/21) Installing binutils-libs (2.26-r1)
(8/21) Installing binutils (2.26-r1)
(9/21) Installing gmp (6.1.0-r0)
(10/21) Installing isl (0.14.1-r0)
(11/21) Installing libgomp (5.3.0-r0)
(12/21) Installing libatomic (5.3.0-r0)
(13/21) Installing pkgconf (0.9.12-r0)
(14/21) Installing pkgconfig (0.25-r1)
(15/21) Installing mpfr3 (3.1.2-r0)
(16/21) Installing mpc1 (1.0.3-r0)
(17/21) Installing gcc (5.3.0-r0)
(18/21) Installing musl-dev (1.1.14-r14)
(19/21) Installing libc-dev (0.7-r0)
(20/21) Installing g++ (5.3.0-r0)
(21/21) Upgrading musl-utils (1.1.14-r12 -> 1.1.14-r14)
Executing busybox-1.24.2-r11.trigger
OK: 230 MiB in 51 packages
/ # ln -s locale.h /usr/include/xlocale.h
/ # pip install numpy==1.11.3 pandas==0.20.2
Collecting numpy==1.11.3
Downloading numpy-1.11.3.zip (4.7MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 4.7MB 242kB/s
Collecting pandas==0.20.2
Downloading pandas-0.20.2.tar.gz (10.3MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 10.3MB 124kB/s
Collecting python-dateutil (from pandas==0.20.2)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 194kB 994kB/s
Collecting pytz>=2011k (from pandas==0.20.2)
Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 491kB 874kB/s
Collecting six>=1.5 (from python-dateutil->pandas==0.20.2)
Downloading six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: numpy, pandas
Running setup.py bdist_wheel for numpy ... done
Stored in directory: /root/.cache/pip/wheels/8f/d6/97/4cc26777ee05997164e480e2e5de2c9e9c4e32dfe325ea5bd6
Running setup.py bdist_wheel for pandas ... done
Stored in directory: /root/.cache/pip/wheels/fc/fd/0a/5857e8bee7d5cc3ca22228fb7ab5efa43be57c0f9103e54098
Successfully built numpy pandas
Installing collected packages: numpy, six, python-dateutil, pytz, pandas
Successfully installed numpy-1.11.3 pandas-0.20.2 python-dateutil-2.6.0 pytz-2017.2 six-1.10.0
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/ # python -c "import pandas"
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pandas/__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: umpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
pip
ํ์ฌ Pandas๋ฅผ ์ค์นํ๋ ๋ฐ ์ฑ๊ณตํ์ง๋ง import pandas
๊ฐ ์ค๋จ๋ฉ๋๋ค.
numpy
์ pandas
๋ผ๋ ๋ ๊ฐ์ ๊ฐ๋ณ pip install
๋ช
๋ น์ ์คํํ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์๋ํฉ๋๋ค.
> docker run --tty --interactive --rm python:2.7.12-alpine ash
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.6-150-gf952adf [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
v3.4.6-83-g67e50bc [http://dl-cdn.alpinelinux.org/alpine/v3.4/community]
OK: 5983 distinct packages available
/ # apk add cython g++ musl-dev
(1/21) Upgrading musl (1.1.14-r12 -> 1.1.14-r14)
(2/21) Installing libffi (3.2.1-r2)
(3/21) Installing python (2.7.12-r0)
(4/21) Installing cython (0.24-r1)
(5/21) Installing libgcc (5.3.0-r0)
(6/21) Installing libstdc++ (5.3.0-r0)
(7/21) Installing binutils-libs (2.26-r1)
(8/21) Installing binutils (2.26-r1)
(9/21) Installing gmp (6.1.0-r0)
(10/21) Installing isl (0.14.1-r0)
(11/21) Installing libgomp (5.3.0-r0)
(12/21) Installing libatomic (5.3.0-r0)
(13/21) Installing pkgconf (0.9.12-r0)
(14/21) Installing pkgconfig (0.25-r1)
(15/21) Installing mpfr3 (3.1.2-r0)
(16/21) Installing mpc1 (1.0.3-r0)
(17/21) Installing gcc (5.3.0-r0)
(18/21) Installing musl-dev (1.1.14-r14)
(19/21) Installing libc-dev (0.7-r0)
(20/21) Installing g++ (5.3.0-r0)
(21/21) Upgrading musl-utils (1.1.14-r12 -> 1.1.14-r14)
Executing busybox-1.24.2-r11.trigger
OK: 230 MiB in 51 packages
/ # ln -s locale.h /usr/include/xlocale.h
/ # pip install numpy==1.11.3
Collecting numpy==1.11.3
Downloading numpy-1.11.3.zip (4.7MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 4.7MB 221kB/s
Building wheels for collected packages: numpy
Running setup.py bdist_wheel for numpy ... done
Stored in directory: /root/.cache/pip/wheels/8f/d6/97/4cc26777ee05997164e480e2e5de2c9e9c4e32dfe325ea5bd6
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.11.3
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/ # pip install pandas==0.20.2
Collecting pandas==0.20.2
Downloading pandas-0.20.2.tar.gz (10.3MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 10.3MB 125kB/s
Collecting python-dateutil (from pandas==0.20.2)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 194kB 787kB/s
Collecting pytz>=2011k (from pandas==0.20.2)
Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 491kB 1.0MB/s
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python2.7/site-packages (from pandas==0.20.2)
Collecting six>=1.5 (from python-dateutil->pandas==0.20.2)
Downloading six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: pandas
Running setup.py bdist_wheel for pandas ... done
Stored in directory: /root/.cache/pip/wheels/fc/fd/0a/5857e8bee7d5cc3ca22228fb7ab5efa43be57c0f9103e54098
Successfully built pandas
Installing collected packages: six, python-dateutil, pytz, pandas
Successfully installed pandas-0.20.2 python-dateutil-2.6.0 pytz-2017.2 six-1.10.0
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/ # python -c "import pandas"
https://github.com/pandas-dev/pandas/issues/11383#issuecomment -294242777๊ณผ ๋งค์ฐ ์ ์ฌํด ๋ณด์ ๋๋ค.
์์ธ ๋ชจ๋๋ฅผ ์ฌ์ฉํ์ฌ ๋์์ ์ํํ ๋ pip์ด ์ก๋ numpy ๋ฒ์ ์ ํ์ธํ ์ ์์ต๋๊น?
numpy
1.13.0
๊ฐ์ต๋๋ค.
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include -I/usr/local/include/python2.7 -c pandas/_libs/testing.c -o build/temp.linux-x86_64-2.7/pandas/_libs/testing.o -Wno-unused-function
gcc -shared build/temp.linux-x86_64-2.7/pandas/_libs/testing.o -L/usr/local/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/pandas/_libs/testing.so
building 'pandas._libs.lib' extension
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include -I/usr/local/include/python2.7 -c pandas/_libs/lib.c -o build/temp.linux-x86_64-2.7/pandas/_libs/lib.o -Wno-unused-function
In file included from /tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1809:0,
from /tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:18,
from /tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include/numpy/arrayobject.h:4,
from pandas/_libs/lib.c:435:
/tmp/pip-build-WbJa3a/pandas/.eggs/numpy-1.13.0-py2.7-linux-x86_64.egg/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
๊ทธ๋ฐ ๋ค์ pip ๋ฌธ์ ์ถ์ ๊ธฐ์ ๋ํด ๋ณด๊ณ ํด ๋ณด์ญ์์ค. setup.py์ ๋ฌธ์ ๊ฐ ์์ ์ ์์ง๋ง bug pip ๋๋ setuptools๊ฐ ๋ ๊ฐ๋ฅ์ฑ์ด ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
@rvernica ํ ์ ๋ค์ด๋ก๋ํ์ฌ ์ค์นํ๋ ๋์ ์์ค์์ ํฌ๋๋ฅผ ๋น๋ํ๋ ํน๋ณํ ์ด์ ๊ฐ ์์ต๋๊น? ๋ฐํด๊ฐ ์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ์์ด ์ค์นํด์ผํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
์ ํ ๋ฒ์ ์ด ๊ทธ๋ ๊ฒ ์ค๋๋ ์ค์ ๋ชฐ๋๋ค์. ๊ทธ๋ฌ๋ฉด ์ด๋ฏธ ์์ ๋์์ ์ ์์ต๋๋ค.
@jorisvandenbossche ์ ๋ pip install
ํ๊ณ ์์ต๋๋ค. pip
๋ ์๋ง๋ ํ ์ด ์๊ธฐ ๋๋ฌธ์ ์์ค์์ ๋น๋ํ๊ธฐ๋ก ์ ํํฉ๋๋ค.
๋จผ์ pip
์
๊ทธ๋ ์ด๋๋ฅผ ์๋ํ์ต๋๋ค.
/ # pip install --upgrade pip
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 1.3MB 480kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.1
๊ทธ๋ฌ๋ ๊ฒฐ๊ณผ๋ ๋์ผํฉ๋๋ค. pip
๋ ์ฑ๊ณตํ์ง๋ง import pandas
์คํจํฉ๋๋ค.
ํ์คํ pandas-0.20.2์ฉ ํ ์ด ์์ด์ผ ํ๋๋ฐ ์ ๋ค์ด๋ก๋๊ฐ ์๋๋์ง ๋ชจ๋ฅด๊ฒ ๋ค์..
๊ทธ๋ฌ๋ ์ด๋ค ์์คํ
์
๋๊น? manylinux
์๊ตฌ ์ฌํญ๊ณผ ํธํ๋์ง ์์ ์ ์์ต๋๋ค.
๊ทธ๋ฌ๋ ์ค์ ๋ก https://github.com/pandas-dev/pandas/issues/11383 ๊ณผ ๋์ผํ ๋ฌธ์ pip
๋ก ์ค์นํ๋ฉด ์ค๋จ๋ฉ๋๋ค. ๊ทธ ์ด์ ๋ pip๊ฐ ์ต์ numpy๋ฅผ ์ฌ์ฉํ๋ ๋ณ๋์ ํ๊ฒฝ์์ ํฌ๋๋ฅผ ๋น๋ํ๋ ๊ฒ์ฒ๋ผ ๋ณด์ด์ง๋ง ์ค์ ํ๊ฒฝ์๋ ์ด์ ๋ฒ์ ์ numpy๊ฐ ์ค์น๋์ด ์์ผ๋ฏ๋ก ์ค๋ฅ๊ฐ ๋ฐ์ํ๊ธฐ ๋๋ฌธ์
๋๋ค. ํด๊ฒฐ์ฑ
์ ๋ ๋จ๊ณ๋ก ์ํํ๋ ๊ฒ์
๋๋ค(๊ทธ๋ฐ ๋ค์ numpy๊ฐ ์ด๋ฏธ ์ค์น๋์ด ์์ผ๋ฉฐ pandas๋ฅผ ๋น๋ํ ๋ ์ด๋ฅผ ์ฌ์ฉํ๊ณ ๋ค๋ฅธ ๊ฒ์ ๊ฐ์ ธ์ค์ง ์์ต๋๋ค).
๋ฐ๋ผ์ ์ด ์ฌ์ฉ ์ฌ๋ก์ ๋ํด pip๊ฐ ์์๋์๊ฑฐ๋ setup.py์์ ์๋ชป๋ ์์
์ ์ํํฉ๋๋ค(ํ์ง๋ง ์ด์ ๋ํ ์ ๋ฌธ๊ฐ๋ ์์).
๋ง์ด๋๋ค. ์์คํ ์ ์ํ์ธ ๋ฆฌ๋ ์ค 3.4์ ๋๋ค.
@rvernica pip ์ด์ ํธ๋์ปค์ ์ ๊ณ ํ์
จ๋์? --no-binary
์ต์
์ ์ฌ์ฉํ์ฌ ์ด๊ฒ์ ์ฌํํ ์ ์๋ค๊ณ ๊ฐ์ ํ์ง๋ง ์ฌ๋ฐ๋ฅธ numpy ๋ฒ์ ์ ๊ฐ์ ธ์์ต๋๋ค.
์๋์, ์ ๊ณ ํ ๊ธฐํ๊ฐ ์์์ต๋๋ค.
--no-binary ์ต์ ์ ์ฌ์ฉํ์ฌ ์ด๊ฒ์ ์ฌํํ ์ ์๋ค๊ณ ๊ฐ์ ํ์ง๋ง ์ฌ๋ฐ๋ฅธ numpy ๋ฒ์ ์ ๊ฐ์ ธ์์ต๋๋ค.
@TomAugspurger ์ด์ ๋ฒ์ ์ numpy๋ฅผ ์ง์ ํ์ต๋๊น? (์: pip install numpy==1.11 pandas==0.20
)
๋ค ๊นจ๋ํ ํ๊ฒฝ์ pip install numpy==1.11.3 pandas==0.20.2 --no-binary=':all:' --verbose
ํ์ต๋๋ค.
ํ์ธ https://github.com/pypa/pip/issues/3691(https://github.com/pypa/pip/pull/4144 ์์ ๊ตฌํ)์ด ์ฌ๋ฐ๋ฅธ ์๋ฃจ์ ์ด๋ฏ๋ก ์ด ์ ์คํธ๋ฆผ์ ๋ณด๊ณ ํ์ง ์๊ฒ ์ต๋๋ค. ํ๋ฒ ํด๋ณด์.
๋น๋ ๋จ๊ณ์์ ๋ฒ์ ์ ๋ณด๊ฐ ์ฌ์ ํ ๋ฌด์๋ ์ ์์ผ๋ฉฐ ์ด ๊ฒฝ์ฐ pip์ ๋ณด๊ณ ํด์ผ ํฉ๋๋ค. pyproject.toml
์ถ๊ฐํ์ฌ ํ๋ณดํ๊ฒ ์ต๋๋ค.
๋๋ PEP518์ด ์ด๊ฒ์ ๋ํด ์ด๋ค ๊ฒ๋ ๋ณ๊ฒฝํ ์ง ํ์ ํ์ง ๋ชปํ๋ค. ์๋ํ๋ฉด ํ๋ค์ค ํ ์ ๋น๋ํ๋ ์๊ฐ์ ๋ฌธ์ ๊ฐ ์ฌ์ ํ ๋จ์ ์๊ธฐ ๋๋ฌธ์ด๋ค(pyproject.toml์์ numpy>0.17 ์ฌ์์ผ๋ก, ์ต์ 1.13์ ๋ค์ด๋ก๋ํ ๊ฒ์) ๋์์ ์ค์น๋ ์ ํํ numpy ๋ฒ์ ์ ๋ํด ์๊ณ ์๋ ๊ฒ ๊ฐ์ต๋๋ค(๋ฐ๋ผ์ ํ ๋น๋ฉ ๋จ๊ณ์์ ์ฌ์ฉ๋ ๋ฒ์ ๋ณด๋ค ์ด์ ๋ฒ์ ์ผ ์ ์์)
์ค์ ๋ก ๋น๋ ์์คํ ์์ ์๊ตฌํ๋ ๊ฐ์ฅ ์ค๋๋ ์ง์ ๋ฒ์ ์ numpy ๋ฒ์ ์ ๊ณ ์ ํด์ผ ํฉ๋๊น? (๋ฐฐํฌํ ๋ฐํด๋ฅผ ๋ง๋ค ๋ ์ค์ ๋ก ๋ฌด์์ ํ๋์?) ์ด๊ฒ์ ๊ฒฉ๋ฆฌ๋ ํ๊ฒฝ์์ ์ํ๋๋ฏ๋ก ์ค์ ํ๊ฒฝ์ ์ํฅ์ ๋ฏธ์น์ง ์์์ผ ํฉ๋๋ค.
์ฌ์ ํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๊น?
์ ๋๊ธ ์ฝ์ด๋ณด์ จ๋์? numpy์ pandas๋ฅผ ๋ณ๋์ ๋ ๋จ๊ณ๋ก ์ค์นํด ๋ณด์ญ์์ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ๊ทํ๊ฐ ๊ฐ์ง๊ณ ์๋ ํน์ ๋ฌธ์ ์ ๋ํด ํจ์ฌ ๋ ์์ธํ ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค.
์๋
,
"pip install numpy==1.12.0 pandas==0.21.0"์ ์ฌ์ฉํ์ฌ ์๋์ผ๋ก ์ค์นํ์ต๋๋ค(์ฐธ๊ณ : ์ด๋ฏธ ๋์ผํ ๋ฒ์ ๋ง ํด๋น).
๋์ค์ python -c " import pandas"๋ฅผ ์ํํ๋ ๋์ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
"C ํ์ฅ์ด ๋จผ์ ์
๋๋ค.".format(module))
ImportError: C ํ์ฅ: numpy.core.multiarray๊ฐ ๋น๋๋์ง ์์ ๊ฐ์ ธ์ค๊ธฐ์ ์คํจํ์ต๋๋ค. ์์ค ๋๋ ํ ๋ฆฌ์์ pandas๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋จผ์ 'python setup.py build_ext --inplace --force'๋ฅผ ์คํํ์ฌ C ํ์ฅ์ ๋น๋ํด์ผ ํ ์ ์์ต๋๋ค.
์์์ ๋งํ๋ฏ์ด ์์ ๋๊ธ์ ์ฝ์ด๋ณด์๊ณ ๊ฐ์ ๋ฌธ์ ๋ผ๋ฉด ๋ฐ๋ก ์ค์น๋ฅผ ํ์
์ผ ํ๋ฏ๋ก pip install numpy=1.12.0
๋ค์ pip install pandas=0.21.0
@jorisvandenbossche ๋ฐ๋ก ์ค์นํ๋๋ฐ๋ ๊ฐ์ ์๋ฌ๊ฐ ๋ฉ๋๋ค. ๋๋ ๋ฐ๋๋ก ํ๋ค. ๋๋ ๋ณ๋์ ๋๋ ํ ๋ฆฌ์ ํ๋ค๋ฅผ ๋ณต์ ํ๊ณ ํ๋ค๋ฅผ ์ค์นํ์ต๋๋ค. ์ฌ๊ธฐ์ ํ๋ค ๊ฐ์ ธ์ค๊ธฐ๋ฅผ ์ํํ ์ ์์ง๋ง ์ธ๋ถ ๋๋ ํ ๋ฆฌ์์ ๋์ผํ ์์ ์ ์ํํ ๋๋ ํญ์ ์คํํ ์์ค ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก๋ฅผ ์ฐพ๊ณ ์์ต๋๋ค.
sudo pip install numpy==1.12.0
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ numpy==1.12.0
์ฐ๋ถํฌ @ocata :~/devstack$ sudo pip install pandas==0.21.0
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ pandas==0.21.0
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas==0.21.0)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: numpy>=1.9.0 in /usr/local/lib/python2.7/dist-packages (from pandas==0.21.0)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ python-dateutil(pandas==0.21.0์์)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ 6>=1.5(python-dateutil->pandas==0.21.0์์)
ubuntu@ocata :~/devstack$ python -c "ํ๋ค ๊ฐ์ ธ์ค๊ธฐ"
RuntimeError: API ๋ฒ์ 0xb์ ๋ํด ๋ชจ๋์ด ์ปดํ์ผ๋์์ง๋ง ์ด ๋ฒ์ ์ numpy๋ 0xa์ ๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "", 1ํ, ์์
ํ์ผ "/usr/local/lib/python2.7/dist-packages/pandas/__init__.py", 35ํ,
"C ํ์ฅ์ด ๋จผ์ ์ ๋๋ค.".format(module))
ImportError: C ํ์ฅ: numpy.core.multiarray๊ฐ ๋น๋๋์ง ์์ ๊ฐ์ ธ์ค๊ธฐ์ ์คํจํ์ต๋๋ค. ์์ค ๋๋ ํ ๋ฆฌ์์ pandas๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋จผ์ 'python setup.py build_ext --inplace --force'๋ฅผ ์คํํ์ฌ C ํ์ฅ์ ๋น๋ํด์ผ ํ ์ ์์ต๋๋ค.
ํจ์ฌ ๋ ์์ธํ ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด ์ํํ ์ฌ๋ฌ ๋จ๊ณ์ ์ ์ฒด ์ฝ์ ์ถ๋ ฅ, ์ด์์ ์ผ๋ก๋ ๋ช ๊ฐ์ง ์์ธํ ์ต์ , ํ๊ฒฝ์ ๋ํ ์ผ๋ถ ์ ๋ณด(์ด๋ค OS, python ๋ฒ์ , ...), ํ ์ด ์๋ ์์ค์์ ์ค์นํ๋์ง, ...
ํ์ด์ฌ 2.7.12
OS: ์ฐ๋ถํฌ 16.04 xenial
๋๋ ๋ฐ๋ผ, ๋จํค๋ฅผ ์ค์นํด์ผ http://gnocchi.xyz/install.html#installation ๊ณณ ๋จํค ์ค์น ํ๋ฌ๊ทธ์ธ ๋ง๋ฌ ./stack.sh์ ์ถ๊ฐ ํ ํ, - ํน์๋ฅผ-devstack https://github.com/gnocchixyz/ gnocchi ๋ pandas๋ฅผ ์ค์น/๊ฐ์ ธ์ค๋ ค๊ณ ํ ๋ pandas ์ข ์์ฑ์ด ์์ต๋๋ค. ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
์ฌ๊ธฐ ํฌ๋์ ๋จํค ํ์ผ ์ข ์์ฑ https://github.com/gnocchixyz/gnocchi/blob/ffbb446f3f12d637a6ff45b3eb522191638e8be0/tools/duration_perf_analyse.py#L37
๋ค๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก, ํฌ๋๋ฅผ ์ค์นํด์ผ ํ๋ค๊ณ ๊ฐ์ ํ๊ณ ๋ณ๋์ ๋๋ ํ ๋ฆฌ์ ๋ณต์ ํ๊ณ ํด๋น ๋ชจ๋์ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ํ ๋๋ ํ ๋ฆฌ์ ์ค์นํ๊ณ ์ธ๋ถ ๋๋ ํ ๋ฆฌ์์ ๊ฐ์ ธ์ค๋ ค๊ณ ํ๋ฉด ์๋ณ๋์ง ์๊ณ ์ด๋์์ ํ ์ ์์ต๋๊น? ์์ค ๋๋ ํ ๋ฆฌ์ ๋ฌด๊ดํ /python/dist-packages/ ์๋์ ์๋ ๋ชจ๋ ๊ฐ์ ธ์ค๊ธฐ
sudo pip ์ค์น ํ๋ค
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ ํฌ๋
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ numpy>=1.9.0(pandas์์)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ python-dateutil(pandas์์)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ 6>=1.5(python-dateutil->pandas์์)
ubuntu@ocata :/usr/local/lib/python2.7/dist-packages$ python -c "ํ๋ค ๊ฐ์ ธ์ค๊ธฐ"
RuntimeError: API ๋ฒ์ 0xb์ ๋ํด ๋ชจ๋์ด ์ปดํ์ผ๋์์ง๋ง ์ด ๋ฒ์ ์ numpy๋ 0xa์
๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "
ํ์ผ "pandas/__init__.py", 35ํ,
"C ํ์ฅ์ด ๋จผ์ ์
๋๋ค.".format(module))
ImportError: C ํ์ฅ: numpy.core.multiarray๊ฐ ๋น๋๋์ง ์์ ๊ฐ์ ธ์ค๊ธฐ์ ์คํจํ์ต๋๋ค. ์์ค ๋๋ ํ ๋ฆฌ์์ pandas๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋จผ์ 'python setup.py build_ext --inplace --force'๋ฅผ ์คํํ์ฌ C ํ์ฅ์ ๋น๋ํด์ผ ํ ์ ์์ต๋๋ค.
@jorisvandenbossche ํ์ํ ๊ฒฝ์ฐ ์ธ๋ถ ์ ๋ณด๋ฅผ ์๋ ค์ฃผ์ญ์์ค.
๋ง์ง๋ง ๋ก๊ทธ ์ถ๋ ฅ์๋ "์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: pandas"๊ฐ ํ์๋๋ฏ๋ก ์ค์ ๋ก ์ค์นํ์ง ์์ต๋๋ค.
๋ํ, pip๊ฐ ๋์ผํ ํ์ด์ฌ์ ์ฐธ์กฐํ๋์ง ํ์ธํ๊ณ (์: python -m pip
do
@jorisvandenbossche s "์ด๋ฏธ ์ถฉ์กฑ๋ ์๊ตฌ์ฌํญ : pandas" - ๋ง์ํ์ ๋๋ก ๋ฐ๋ก ์ค์น๋ฅผ ํด์ ๋ค์ ํ๋ฉด ๊ผญ ๊ทธ๋ ๊ฒ
dist ํจํค์ง์์ ํฌ๋๋ฅผ ๊ฐ์ ธ์ค๋ ์ด์ ๋ ๋ฌด์์ ๋๊น? -->> ๋ชจ๋ ๊ณณ์์ ์๋ํ์ง๋ง ์คํ๋์ง ์์ต๋๋ค.
ํ์ด์ฌ์ด 2.7์ธ ์ฐ๋ถํฌ 16.04์์ ํ๋ค๋ฅผ ์ค์นํ๋ ๋ฐฉ๋ฒ์ ์๋ ค์ฃผ์ญ์์ค.
์ง๊ธ๊น์ง ๋ด๊ฐ ์ค์นํ ์ ์ ํ ๊ธฐ๊ณ์์
pip install numpy==1.12.0 ๋ค์ โโpip install pandas==0.21.0,
์ค์น ํ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํจ
pip install numpy==1.12.0 ๋ค์ โโpip install pandas==0.21.0 ์ค์น ํ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํจ
๊ทธ๋ฐ ๋ค์ ์ ์ฒด ๋ก๊ทธ๋ฅผ ํ์ํฉ๋๋ค(์ค์ ๋ก ์๋ฌด ๊ฒ๋ ์ค์นํ์ง ์๋ ๋ก๊ทธ๊ฐ ์๋๋ผ numpy์ pandas๊ฐ ์์ง ์ค์น๋์ง ์์ ์๋ก์ด ํ๊ฒฝ์์ ์ด ์์ ์ ์ํํด์ผ ํจ).
@jorisvandenbossche ์ฌ๊ธฐ์์ ์๋ก์ด ๊ธฐ๊ณ ์ค์น
sudo pip ์ค์น ํ๋ค
ํฌ๋ ์์ง
์บ์๋ pandas-0.21.0-cp27-cp27mu-manylinux1_x86_64.whl ์ฌ์ฉ
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/lib/python2.7/dist-packages์ numpy>=1.9.0(pandas์์)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ python-dateutil(pandas์์)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/local/lib/python2.7/dist-packages์ 6>=1.5(python-dateutil->pandas์์)
์์ง๋ ํจํค์ง ์ค์น: pandas
pandas-0.21.0์ ์ฑ๊ณต์ ์ผ๋ก ์ค์นํ์ต๋๋ค.
ubuntu@ocata :~$ sudo pip install numpy
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/lib/python2.7/dist-packages์ numpy
ubuntu@ocata :~$ python -c "ํ๋ค ๊ฐ์ ธ์ค๊ธฐ"
RuntimeError: API ๋ฒ์ 0xb์ ๋ํด ๋ชจ๋์ด ์ปดํ์ผ๋์์ง๋ง ์ด ๋ฒ์ ์ numpy๋ 0xa์
๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "
ํ์ผ "/usr/local/lib/python2.7/dist-packages/pandas/__init__.py", 35ํ,
"C ํ์ฅ์ด ๋จผ์ ์
๋๋ค.".format(module))
ImportError: C ํ์ฅ: numpy.core.multiarray๊ฐ ๋น๋๋์ง ์์ ๊ฐ์ ธ์ค๊ธฐ์ ์คํจํ์ต๋๋ค. ์์ค ๋๋ ํ ๋ฆฌ์์ pandas๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋จผ์ 'python setup.py build_ext --inplace --force'๋ฅผ ์คํํ์ฌ C ํ์ฅ์ ๋น๋ํด์ผ ํ ์ ์์ต๋๋ค.
pandas๋ณด๋ค ๋จผ์ numpy๋ฅผ ์ค์นํด์ผ ํฉ๋๋ค(์ด ๊ฒฝ์ฐ numpy๊ฐ ์ด๋ฏธ ์ค์น๋ ๊ฒ์ฒ๋ผ ์์ฒด์ ์ผ๋ก ์ค์น๋์ง ์์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๊ฐ ๋์ง๋ ์์์ง๋ง). numpy์ pandas(๊ทธ๋ฆฌ๊ณ numpy๋ฅผ ๋จผ์ ์ค์น)๋ฅผ ์๋ก ์ค์นํ์ฌ ๋์ผํ๊ฒ ํ์ํ ์ ์์ต๋๊น?
BTW, numpy ๊ฐ์ ธ์ค๊ธฐ๊ฐ ์๋ํฉ๋๊น?
@jorisvandenbossche๋ ๋จผ์ numpy๋ฅผ ์ค์นํ๊ณ ๊ฐ์ ธ์ค๊ธฐ์ ์ ์๋ํ๊ณ pandas๋ฅผ ์ค์นํ๊ณ ๊ฐ์ ธ์ค๊ธฐ๋ ๊ด์ฐฎ์ง๋ง gnocchi์ ๋ฐ๋ผ ./stack.sh๋ฅผ ์ํํ๋ ๋์ pandas ๊ฐ์ ธ์ค๊ธฐ๋ ๊ฐ์ ธ์ค๊ธฐ numpy๊ฐ ๊ด์ฐฎ์ ๊ณณ์์ ์ค๋ฅ์ ๋๋ค.
sudo python
๋ python
์ ๋ค๋ฅผ ์ ์์ต๋๋ค. python -m pip install ...
๋ฅผ ์ฌ์ฉํ๊ณ ํ์ํ ๊ฒฝ์ฐ์๋ง sudo
์ฌ์ฉํ์ญ์์ค.
@TomAugspurger ๋๋ ๋ ๋ค ๊ฒฐํฉํ์ง ์์์ผ๋ฉฐ pip install์ ์ฌ์ฉํ์ฌ pandas๋ฅผ ์ค์น
์ฌ๊ธฐ ๋ด ์ง๋ฌธ; numpy=1.12.0์ด pandas=0.21.0๊ณผ ํธํ๋๋์ง ์ฌ๋ถ
๋๋ ํธํ๋๋ ๊ฒ์ ๋ฌด์์ ๋๊น?
๋๋ numpy ์ต์ ๊ณผ pandas ์ต์ ์ ์๋ํ์ต๋๋ค. ์ฌ์ ํ ์๋ํ์ง ์์ต๋๋ค. ํธํ์ฑ ๋ฌธ์ ๊ฐ ์์ต๋๊น? ๋๋ ๊ฐ์ฅ ์ ํธํ๋๋ numpy & pandas ๋ฒ์ ?
@maestropandy ๋ ๊ฒฝ๋ก๋ฅผ ์ดํด๋ด ๋๋ค.
sudo pip install pandas
Collecting pandas
Using cached pandas-0.21.0-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas)
ubuntu<strong i="9">@ocata</strong>:~$ sudo pip install numpy
Requirement already satisfied: numpy in /usr/lib/python2.7/dist-packages
์ฒซ ๋ฒ์งธ๋ /usr/local/lib
, ๋ ๋ฒ์งธ๋ /usr/lib
์ด๋ฏ๋ก ๋ญ๊ฐ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ๊ทํ์ ์์ธ๋ usr/local/lib
์ ํ์ด์ฌ์์ ๋ฐ์ํฉ๋๋ค.
@TomAugspurger "sudo python -m pip install numpy"๊ฐ /usr/local/lib/์ ์ค์น๋ฉ๋๊น? ์๋ ํ ๊ฒ์ ๋๋ค.
๋ํ numpy>=1.9.0 & pandas>=0.18.0์ ์ค์นํ๊ธฐ ๋๋ฌธ์ numpy ๋ฐ pandas์ ํธํ์ฑ ๋ฌธ์ ๊ฐ ์๋์ง ์๋ ค์ฃผ์ญ์์ค. ์ด๋ numpy์ pandas ์ต์ ๋ฒ์ ์ ๋ชจ๋ ์๋ฏธํ์ง๋ง ํธํ๋์ง ์๋ ๊ฒ ๊ฐ์ต๋๊น?
๋ํ numpy ๋ฐ pandas์์ ํธํ์ฑ ๋ฌธ์ ๊ฐ ์๋์ง ์๋ ค์ฃผ์ญ์์ค.
์ผ๋ฐ์ ์ผ๋ก ์ธ๊ธํ๋ ๋ฒ์ ๊ฐ์๋ ๋นํธํ์ฑ์ด ์์ต๋๋ค. ๋ฌธ์ ๋ ๋ ๋ค ์ค์นํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
์ ํ๋ค ๋ฒ์ ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ ๋๊น์ง pip install pandas==0.20.2
์ฌ์ฉํ์ธ์.
@abhishekg2389 ๋ ๋ง์ ์ ๋ณด๋ฅผ ์ ๊ณตํ ์ ์์ต๋๊น? ๋น๋ ํ์ผ์ ๋ฌธ์ ๊ฐ ์๋ ๊ฒฝ์ฐ ์๊ณ ์ถ์ต๋๋ค.
Fedora 25์์ ์ ์ฌํ(๋์ผํ?) ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
$ python --version
Python 2.7.13
$ which python
/usr/bin/python
md5-c7b975f7c1ac4eb89f5fe68ce1d09cd7
$ sudo pip install pandas
[sudo] password for .....:
Requirement already satisfied: pandas in /usr/lib64/python2.7/site-packages
Requirement already satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas)
Requirement already satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from pandas)
Requirement already satisfied: numpy>=1.9.0 in /usr/lib64/python2.7/site-packages (from pandas)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil->pandas)
$ sudo pip install numpy
Requirement already satisfied: numpy in /usr/lib64/python2.7/site-packages
md5-79f115fb1bb7ca0fecb38162c5f341da
$ python testPandas.py
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
File "runProphet.py", line 1, in <module>
import pandas as pd
File "/usr/lib64/python2.7/site-packages/pandas/__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: numpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
md5-fca2a04366ebb14ff185882c94092f99
$ sudo pip install pandas==0.20.2
[sudo] password for jbooker:
Collecting pandas==0.20.2
Downloading pandas-0.20.2-cp27-cp27mu-manylinux1_x86_64.whl (22.4MB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 22.4MB 79kB/s
Requirement already satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas==0.20.2)
Requirement already satisfied: numpy>=1.7.0 in /usr/lib64/python2.7/site-packages (from pandas==0.20.2)
Requirement already satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from pandas==0.20.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil->pandas==0.20.2)
Installing collected packages: pandas
Found existing installation: pandas 0.21.0
Uninstalling pandas-0.21.0:
Successfully uninstalled pandas-0.21.0
Successfully installed pandas-0.20.2
์ด๋ค ๋ฒ์ ์ numpy๊ฐ ์ค์น๋์ด ์์ต๋๊น? ๊ทธ๋ฆฌ๊ณ pandas 0.21.0์ ์ค์นํ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ค ์ ์์ต๋๊น? (๋น์ ์ด ๋ณด์ฌ์ฃผ๋ ๊ฒ์ ๊ทธ ์์ ์ ์ด๋ฏธ ์ค์น๋์ด ์๊ธฐ ๋๋ฌธ์ ์ค์ ๋ก ์ค์น๋์ง ์์ต๋๋ค)
$ pip show numpy
Name: numpy
Version: 1.11.2
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: NumPy Developers
Author-email: [email protected]
License: BSD
Location: /usr/lib64/python2.7/site-packages
pandas 0.21.0์ ์ค์นํ ๊ฒฐ๊ณผ๊ฐ ๋์ค์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ด ์์คํ (??)์ ์ด๋ฏธ ์ค์น๋ ๊ฒ ๊ฐ์ต๋๋ค. RPM ํจํค์ง๊ฐ ํ์๋์ง ์์ yum/dnf ์์คํ ํจํค์ง๋ฅผ ํตํด ์ค์น๋์ง ์์์ต๋๋ค.
Facebook์ Prophet ํจํค์ง(Pandas ๋ฐ Numpy์ ์ข ์๋จ)๋ฅผ ์ค์นํ๋ ค๊ณ ์๋ํ๋๋ฐ pandas 0.18.1์ด ์ด๋ฏธ ์ค์น๋์ด ์๋ค๊ณ ํ์๋ฉ๋๋ค. 0.21.0์ด ์๋๋ผ 0.18.1์ด๋ผ๋ ์ฌ์ค์ด ํฅ๋ฏธ๋กญ์ต๋๋ค.
$ sudo pip install fbprophet
Collecting fbprophet
Using cached fbprophet-0.2.1.tar.gz
Requirement already satisfied: matplotlib in /usr/lib64/python2.7/site-packages (from fbprophet)
Requirement already satisfied: pandas>=0.18.1 in /usr/lib64/python2.7/site-packages (from fbprophet)
Requirement already satisfied: pystan>=2.14 in /usr/lib64/python2.7/site-packages (from fbprophet)
Requirement already satisfied: cycler>=0.10 in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: subprocess32 in /usr/lib64/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: six>=1.10 in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: backports.functools-lru-cache in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: numpy>=1.7.1 in /usr/lib64/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: python-dateutil>=2.0 in /usr/lib/python2.7/site-packages (from matplotlib->fbprophet)
Requirement already satisfied: Cython!=0.25.1,>=0.22 in /usr/lib64/python2.7/site-packages (from pystan>=2.14->fbprophet)
Installing collected packages: fbprophet
Running setup.py install for fbprophet ... done
Successfully installed fbprophet-0.2.1
ํ๋ค๊ฐ ์ด๋ป๊ฒ ์ค์น๋์๋์ง ๋ชจ๋ฅด๋ฉด ๋์์ด ์ด๋ ต์ต๋๋ค. pandas๋ฅผ ๋ค์ 0.21.0์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ์ฌ ์๋ํ๋์ง ํ์ธํ๊ณ ์ถ๋ ฅ์ ๊ธฐ๋กํ์๊ฒ ์ต๋๊น?
0.21.0์ด ์๋๋ผ 0.18.1์ด๋ผ๋ ์ฌ์ค์ด ํฅ๋ฏธ๋กญ์ต๋๋ค.
>=0.18.1์ด๋ผ๊ณ ๋ง ํ์๋๋ฏ๋ก 0.21.0์ด ๋ ์ ์์ต๋๋ค.
์ ๋ง๋ค. '>='๋ฅผ ๋์ณค์ต๋๋ค. ํน์ ๋ฒ์ ์ด ์๋๋ผ ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ๋ค๋ ๊ฒ๋ฟ์ ๋๋ค.
0.21.0์ผ๋ก ๋ค์ ์ ๊ทธ๋ ์ด๋๋ฅผ ์๋ํ๋๋ฐ ๊ฐ์ ธ์ฌ ๋ ์ค๋ฅ๊ฐ ๋ค์ ๋ฐ์ํ์ต๋๋ค(์ค์น๋ ์ ๋๋ก ์๋ํ์ง๋ง).
$ sudo pip install pandas==0.21.0
[sudo] password for jbooker:
Collecting pandas==0.21.0
Using cached pandas-0.21.0-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas==0.21.0)
Requirement already satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from pandas==0.21.0)
Requirement already satisfied: numpy>=1.9.0 in /usr/lib64/python2.7/site-packages (from pandas==0.21.0)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil->pandas==0.21.0)
Installing collected packages: pandas
Found existing installation: pandas 0.20.2
Uninstalling pandas-0.20.2:
Successfully uninstalled pandas-0.20.2
Successfully installed pandas-0.21.0
ํ ์คํธ ์คํฌ๋ฆฝํธ:
import pandas as pd
import numpy as np
print "Hello, world."
์ค๋ฅ๋ฅผ ๋ค์ ์ถ๋ ฅํฉ๋๋ค.
$ python testPandas.py
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
File "runProphet.py", line 1, in <module>
import pandas as pd
File "/usr/lib64/python2.7/site-packages/pandas/__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: numpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
0.20.2๋ก ๋ค์ด๊ทธ๋ ์ด๋ํ๋ฉด ์ ๋๋ก ์๋ํ๊ณ ํ ์คํธ ์คํฌ๋ฆฝํธ๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์คํ๋ฉ๋๋ค.
์ด ๋ฒ์๋ฅผ ์ขํ๊ธฐ ์ํด ๋ด๊ฐ ํ ์ ์๋ ๋ค๋ฅธ ์ผ์ ๋ฌด์์ ๋๊น?
์ข์, ๋๋ ์ด๊ฒ์ ์ค์ ๋ก ์ฌํํ ์ ์๋ค. ์ ๊ณ ๊ฐ์ฌํฉ๋๋ค!
์ด ๋ฌธ์ ๋ฅผ ๋ค์ ์ด์ง๋ง ์ ๋ฌธ์ ๋ก(์ฌ๊ธฐ์ ์๋ ๋ฌธ์ ๋ ์์ค์์ ๋น๋ํ๋ ๋ค๋ฅธ ๋ฌธ์ ์๊ธฐ ๋๋ฌธ์)
@jlbooker ๋ https://github.com/pandas-dev/pandas/issues/18530 ์์ ์ด๋ฅผ ์ถ์ ํ๊ธฐ ์ํด ๋ฌธ์ ๋ฅผ ์ด์์ต๋๋ค.
์ด ๋ฌธ์ ๋ฅผ ๋นจ๋ฆฌ ํด๊ฒฐํ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๋๋ฅผ ์ํด์ด ๋ฌธ์ ๋ ํฌ๋ ์์ฒด๋ฅผ ์ ๊ฑฐํ๊ณ ๋ค์ ์ค์นํ์ฌ ํด๊ฒฐ๋์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
@jlbooker ๋ https://github.com/pandas-dev/pandas/issues/18530 ์์ ์ด๋ฅผ ์ถ์ ํ๊ธฐ ์ํด ๋ฌธ์ ๋ฅผ ์ด์์ต๋๋ค.
์ด ๋ฌธ์ ๋ฅผ ๋นจ๋ฆฌ ํด๊ฒฐํ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.