Hdbscan: hdbscan์„ ๊ฐ€์ ธ์˜ค๋Š” ๋™์•ˆ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2015๋…„ 12์›” 04์ผ  ยท  10์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: scikit-learn-contrib/hdbscan

ํ•˜๋ ค๊ณ  ํ•˜๋Š” ๋™์•ˆ ๋‹ค์Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. import hdbscan

์ €๋Š” Windows 7 ์‹œ์Šคํ…œ์— ์žˆ์œผ๋ฉฐ conda๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ 64๋น„ํŠธ Python์„ ์„ค์น˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ค๋ฅ˜:

ImportError                               Traceback (most recent call last)
<ipython-input-12-3f1c79fb1b69> in <module>()
----> 1 import hdbscan

c:\anaconda2\lib\site-packages\hdbscan-0.6.2-py2.7-macosx-10.5-x86_64.egg\hdbscan\__init__.py in <module>()

c:\anaconda2\lib\site-packages\hdbscan-0.6.2-py2.7-macosx-10.5-x86_64.egg\hdbscan\hdbscan_.py in <module>()

c:\anaconda2\lib\site-packages\hdbscan-0.6.2-py2.7-macosx-10.5-x86_64.egg\hdbscan\_hdbscan_linkage.py in <module>()

c:\anaconda2\lib\site-packages\hdbscan-0.6.2-py2.7-macosx-10.5-x86_64.egg\hdbscan\_hdbscan_linkage.py in __bootstrap__()

ImportError: DLL load failed: %1 is not a valid Win32 application.

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

๊ณผ์—ฐ ํ•์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋ฌธ์ œ๋Š” ๋ฒ„์ „ 1.10 ์ด์ƒ์— cython์ด ํ•„์š”ํ•œ numpy ๋•Œ๋ฌธ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. Cython ์„ค์น˜ ์‹œ ์ž˜ ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋น ๋ฅธ ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

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

์ €๋Š” conda ํŒจํ‚ค์ง€๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐ ์กฐ๊ธˆ ์ต์ˆ™ํ•ฉ๋‹ˆ๋‹ค. ๋ถˆํ–‰ํžˆ๋„ ์•„์ง ๋ฐฐ์›Œ์•ผ ํ•  ๊ฒƒ์ด ์žˆ๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋‚ด๊ฐ€ ๋งŒ๋“  conda ํŒจํ‚ค์ง€์˜ ๊ฒฐํ•จ์ž…๋‹ˆ๋‹ค. conda(์ฃผ๋กœ scikit-learn ๋ฐ cython)๋ฅผ ํ†ตํ•ด ์š”๊ตฌ ์‚ฌํ•ญ์„ ์„ค์น˜ํ•œ ๋‹ค์Œ pip install ๋˜๋Š” install from source๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค. ์‹ ๊ณ ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋‚˜๋Š” ์ฝ˜๋‹ค ํŒจํ‚ค์ง• ๋ฌธ์ œ๋ฅผ ์กฐ์‚ฌํ•˜๊ณ  ๊ฑฐ๊ธฐ์—์„œ ๋ฌด์—‡์ด ์ž˜๋ชป๋˜๊ณ  ์žˆ๋Š”์ง€ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋น ๋ฅธ ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

์„ค์น˜๊ฐ€ ์—ฌ์ „ํžˆ ์ž‘๋™ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. conda 32๋น„ํŠธ ํŒจํ‚ค์ง€์™€ 64๋น„ํŠธ ํŒจํ‚ค์ง€ ๋ชจ๋‘์—์„œ ์‹œ๋„ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ž‘๋™ํ•˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ๋Š” ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๊นŒ?

pip ์„ค์น˜์˜ ๊ฒฝ์šฐ ์˜ค๋ฅ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

[Anaconda2] C:\Users\user_name>pip install hdbscan
Collecting hdbscan
  Using cached hdbscan-0.6.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): scikit-learn>=0.16 in
c:\anaconda2\lib\site-packages (from hdbscan)
Requirement already satisfied (use --upgrade to upgrade): cython>=0.17 in c:\ana
conda2\lib\site-packages (from hdbscan)
Building wheels for collected packages: hdbscan
  Running setup.py bdist_wheel for hdbscan
  Complete output from command C:\Anaconda2\python.exe -c "import setuptools;__f
ile__='c:\\users\\user_name\\appdata\\local\\temp\\pip-build-yf7q3s\\hdbscan\\setup.
py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))
" bdist_wheel -d c:\users\user_name\appdata\local\temp\tmpbmg3edpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\hdbscan
  copying hdbscan\hdbscan_.py -> build\lib.win-amd64-2.7\hdbscan
  copying hdbscan\plots.py -> build\lib.win-amd64-2.7\hdbscan
  copying hdbscan\robust_single_linkage_.py -> build\lib.win-amd64-2.7\hdbscan
  copying hdbscan\__init__.py -> build\lib.win-amd64-2.7\hdbscan
  running build_ext
  skipping 'hdbscan\_hdbscan_tree.c' Cython extension (up-to-date)
  building 'hdbscan._hdbscan_tree' extension
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  creating build\temp.win-amd64-2.7\Release\hdbscan
  C:\Users\user_name\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9
.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda2\lib\s
ite-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC /Tchdbs
can\_hdbscan_tree.c /Fobuild\temp.win-amd64-2.7\Release\hdbscan\_hdbscan_tree.ob
j
  _hdbscan_tree.c
  c:\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api
.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO
_DEPRECATED_API NPY_1_7_API_VERSION
  hdbscan\_hdbscan_tree.c(2560) : warning C4244: 'function' : conversion from '_
_pyx_t_5numpy_intp_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(2787) : warning C4244: '=' : conversion from '__pyx_t_
5numpy_intp_t' to 'int', possible loss of data
  hdbscan\_hdbscan_tree.c(2820) : warning C4244: '+=' : conversion from 'Py_ssiz
e_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(2831) : warning C4244: '+=' : conversion from 'Py_ssiz
e_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(2842) : warning C4244: '+=' : conversion from 'Py_ssiz
e_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(2854) : warning C4244: '+=' : conversion from 'Py_ssiz
e_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(2899) : warning C4244: '=' : conversion from '__pyx_t_
5numpy_intp_t' to 'int', possible loss of data
  hdbscan\_hdbscan_tree.c(2940) : warning C4244: '=' : conversion from '__pyx_t_
5numpy_intp_t' to 'int', possible loss of data
  hdbscan\_hdbscan_tree.c(4122) : warning C4244: 'function' : conversion from '_
_pyx_t_5numpy_intp_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(5242) : warning C4244: 'function' : conversion from '_
_pyx_t_5numpy_intp_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(6278) : warning C4244: 'function' : conversion from '_
_pyx_t_5numpy_intp_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(6351) : warning C4244: 'function' : conversion from '_
_pyx_t_5numpy_intp_t' to 'long', possible loss of data
  hdbscan\_hdbscan_tree.c(21049) : error C2275: 'PyGILState_STATE' : illegal use
 of this type as an expression
          C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_S
TATE'
  hdbscan\_hdbscan_tree.c(21049) : error C2146: syntax error : missing ';' befor
e identifier '__pyx_gilstate_save'
  hdbscan\_hdbscan_tree.c(21049) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(21120) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(21146) : error C2275: 'PyGILState_STATE' : illegal use
 of this type as an expression
          C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_S
TATE'
  hdbscan\_hdbscan_tree.c(21146) : error C2146: syntax error : missing ';' befor
e identifier '__pyx_gilstate_save'
  hdbscan\_hdbscan_tree.c(21146) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(21219) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(21246) : error C2275: 'PyGILState_STATE' : illegal use
 of this type as an expression
          C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_S
TATE'
  hdbscan\_hdbscan_tree.c(21246) : error C2146: syntax error : missing ';' befor
e identifier '__pyx_gilstate_save'
  hdbscan\_hdbscan_tree.c(21246) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(21336) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(22003) : error C2275: 'PyGILState_STATE' : illegal use
 of this type as an expression
          C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_S
TATE'
  hdbscan\_hdbscan_tree.c(22003) : error C2146: syntax error : missing ';' befor
e identifier '__pyx_gilstate_save'
  hdbscan\_hdbscan_tree.c(22003) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  hdbscan\_hdbscan_tree.c(22029) : error C2065: '__pyx_gilstate_save' : undeclar
ed identifier
  error: command 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Common\\Microsoft\
\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for hdbscan
Failed to build hdbscan
Installing collected packages: hdbscan
  Running setup.py install for hdbscan
    Complete output from command C:\Anaconda2\python.exe -c "import setuptools,
tokenize;__file__='c:\\users\\user_name\\appdata\\local\\temp\\pip-build-yf7q3s\\hdb
scan\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().re
place('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user_name\appdata
\local\temp\pip-a6ueto-record\install-record.txt --single-version-externally-man
aged --compile:
    running install
    running build
    running build_py
    running build_ext
    skipping 'hdbscan\_hdbscan_tree.c' Cython extension (up-to-date)
    building 'hdbscan._hdbscan_tree' extension
    C:\Users\user_name\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda2\lib
\site-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC /Tchd
bscan\_hdbscan_tree.c /Fobuild\temp.win-amd64-2.7\Release\hdbscan\_hdbscan_tree.
obj
    _hdbscan_tree.c
    c:\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_a
pi.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_
NO_DEPRECATED_API NPY_1_7_API_VERSION
    hdbscan\_hdbscan_tree.c(2560) : warning C4244: 'function' : conversion from
'__pyx_t_5numpy_intp_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(2787) : warning C4244: '=' : conversion from '__pyx_
t_5numpy_intp_t' to 'int', possible loss of data
    hdbscan\_hdbscan_tree.c(2820) : warning C4244: '+=' : conversion from 'Py_ss
ize_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(2831) : warning C4244: '+=' : conversion from 'Py_ss
ize_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(2842) : warning C4244: '+=' : conversion from 'Py_ss
ize_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(2854) : warning C4244: '+=' : conversion from 'Py_ss
ize_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(2899) : warning C4244: '=' : conversion from '__pyx_
t_5numpy_intp_t' to 'int', possible loss of data
    hdbscan\_hdbscan_tree.c(2940) : warning C4244: '=' : conversion from '__pyx_
t_5numpy_intp_t' to 'int', possible loss of data
    hdbscan\_hdbscan_tree.c(4122) : warning C4244: 'function' : conversion from
'__pyx_t_5numpy_intp_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(5242) : warning C4244: 'function' : conversion from
'__pyx_t_5numpy_intp_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(6278) : warning C4244: 'function' : conversion from
'__pyx_t_5numpy_intp_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(6351) : warning C4244: 'function' : conversion from
'__pyx_t_5numpy_intp_t' to 'long', possible loss of data
    hdbscan\_hdbscan_tree.c(21049) : error C2275: 'PyGILState_STATE' : illegal u
se of this type as an expression
            C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState
_STATE'
    hdbscan\_hdbscan_tree.c(21049) : error C2146: syntax error : missing ';' bef
ore identifier '__pyx_gilstate_save'
    hdbscan\_hdbscan_tree.c(21049) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(21120) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(21146) : error C2275: 'PyGILState_STATE' : illegal u
se of this type as an expression
            C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState
_STATE'
    hdbscan\_hdbscan_tree.c(21146) : error C2146: syntax error : missing ';' bef
ore identifier '__pyx_gilstate_save'
    hdbscan\_hdbscan_tree.c(21146) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(21219) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(21246) : error C2275: 'PyGILState_STATE' : illegal u
se of this type as an expression
            C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState
_STATE'
    hdbscan\_hdbscan_tree.c(21246) : error C2146: syntax error : missing ';' bef
ore identifier '__pyx_gilstate_save'
    hdbscan\_hdbscan_tree.c(21246) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(21336) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(22003) : error C2275: 'PyGILState_STATE' : illegal u
se of this type as an expression
            C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState
_STATE'
    hdbscan\_hdbscan_tree.c(22003) : error C2146: syntax error : missing ';' bef
ore identifier '__pyx_gilstate_save'
    hdbscan\_hdbscan_tree.c(22003) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    hdbscan\_hdbscan_tree.c(22029) : error C2065: '__pyx_gilstate_save' : undecl
ared identifier
    error: command 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Common\\Microsof
t\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2


    ----------------------------------------
Command "C:\Anaconda2\python.exe -c "import setuptools, tokenize;__file__='c:\\u
sers\\user_name\\appdata\\local\\temp\\pip-build-yf7q3s\\hdbscan\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\user_name\appdata\local\temp\pip-a6ueto-r
ecord\install-record.txt --single-version-externally-managed --compile" failed w
ith error code 1 in c:\users\user_name\appdata\local\temp\pip-build-yf7q3s\hdbscan

์ˆ˜๋™ ์„ค์น˜์˜ ๊ฒฝ์šฐ:

F:\downloads\hdbscan-master\hdbscan-master>python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to hdbscan.egg-info\requires.txt
writing hdbscan.egg-info\PKG-INFO
writing top-level names to hdbscan.egg-info\top_level.txt
writing dependency_links to hdbscan.egg-info\dependency_links.txt
reading manifest file 'hdbscan.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'hdbscan.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\hdbscan
copying hdbscan\hdbscan_.py -> build\lib.win-amd64-2.7\hdbscan
copying hdbscan\plots.py -> build\lib.win-amd64-2.7\hdbscan
copying hdbscan\robust_single_linkage_.py -> build\lib.win-amd64-2.7\hdbscan
copying hdbscan\__init__.py -> build\lib.win-amd64-2.7\hdbscan
running build_ext
skipping 'hdbscan\_hdbscan_tree.c' Cython extension (up-to-date)
building 'hdbscan._hdbscan_tree' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\hdbscan
C:\Users\Intel\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0
\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Anaconda2\lib\sit
e-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC /Tchdbsca
n\_hdbscan_tree.c /Fobuild\temp.win-amd64-2.7\Release\hdbscan\_hdbscan_tree.obj
_hdbscan_tree.c
c:\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h
(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_D
EPRECATED_API NPY_1_7_API_VERSION
hdbscan\_hdbscan_tree.c(2560) : warning C4244: 'function' : conversion from '__p
yx_t_5numpy_intp_t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(2787) : warning C4244: '=' : conversion from '__pyx_t_5n
umpy_intp_t' to 'int', possible loss of data
hdbscan\_hdbscan_tree.c(2820) : warning C4244: '+=' : conversion from 'Py_ssize_
t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(2831) : warning C4244: '+=' : conversion from 'Py_ssize_
t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(2842) : warning C4244: '+=' : conversion from 'Py_ssize_
t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(2854) : warning C4244: '+=' : conversion from 'Py_ssize_
t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(2899) : warning C4244: '=' : conversion from '__pyx_t_5n
umpy_intp_t' to 'int', possible loss of data
hdbscan\_hdbscan_tree.c(2940) : warning C4244: '=' : conversion from '__pyx_t_5n
umpy_intp_t' to 'int', possible loss of data
hdbscan\_hdbscan_tree.c(4122) : warning C4244: 'function' : conversion from '__p
yx_t_5numpy_intp_t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(5242) : warning C4244: 'function' : conversion from '__p
yx_t_5numpy_intp_t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(6278) : warning C4244: 'function' : conversion from '__p
yx_t_5numpy_intp_t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(6351) : warning C4244: 'function' : conversion from '__p
yx_t_5numpy_intp_t' to 'long', possible loss of data
hdbscan\_hdbscan_tree.c(21049) : error C2275: 'PyGILState_STATE' : illegal use o
f this type as an expression
        C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_STA
TE'
hdbscan\_hdbscan_tree.c(21049) : error C2146: syntax error : missing ';' before
identifier '__pyx_gilstate_save'
hdbscan\_hdbscan_tree.c(21049) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(21120) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(21146) : error C2275: 'PyGILState_STATE' : illegal use o
f this type as an expression
        C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_STA
TE'
hdbscan\_hdbscan_tree.c(21146) : error C2146: syntax error : missing ';' before
identifier '__pyx_gilstate_save'
hdbscan\_hdbscan_tree.c(21146) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(21219) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(21246) : error C2275: 'PyGILState_STATE' : illegal use o
f this type as an expression
        C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_STA
TE'
hdbscan\_hdbscan_tree.c(21246) : error C2146: syntax error : missing ';' before
identifier '__pyx_gilstate_save'
hdbscan\_hdbscan_tree.c(21246) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(21336) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(22003) : error C2275: 'PyGILState_STATE' : illegal use o
f this type as an expression
        C:\Anaconda2\include\pystate.h(137) : see declaration of 'PyGILState_STA
TE'
hdbscan\_hdbscan_tree.c(22003) : error C2146: syntax error : missing ';' before
identifier '__pyx_gilstate_save'
hdbscan\_hdbscan_tree.c(22003) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
hdbscan\_hdbscan_tree.c(22029) : error C2065: '__pyx_gilstate_save' : undeclared
 identifier
error: command 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Common\\Microsoft\\V
isual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

์ข‹์ง€ ์•Š์•„ ๋ณด์ธ๋‹ค. ์—ฌ๊ธฐ์„œ ๋ฌด์—‡์ด ์ž˜๋ชป๋˜์—ˆ๋Š”์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ์ €๋Š” Windows์— ์„ค์น˜ํ•œ ๊ฒฝํ—˜์ด ๊ฑฐ์˜ ์—†์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™ ์„ค์น˜๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  hdbscan ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ๋Š” ๋ชจ๋“  .c ํŒŒ์ผ์„ ์‚ญ์ œํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ฆ‰

hdbscan/_hdbscan_tree.c
hdbscan/_hdbscan_boruvka.x
hdbscan/_hdbscan_linkage.c
hdbscan/_hdbscan_reachability.c

๊ทธ๋Ÿฐ ๋‹ค์Œ ๋‹ค์‹œ ๋นŒ๋“œํ•ด ๋ณด์„ธ์š”. Windows๊ฐ€ ์ข‹์•„ํ•˜์ง€ ์•Š๋Š” C ํŒŒ์ผ์— ๋ฌด์–ธ๊ฐ€๊ฐ€ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์šฐ๋ถ„ํˆฌ์—์„œ ์‹œ๋„ํ–ˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ถ„ํˆฌ์—์„œ ์ž˜ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค

์ž‘์—…์— ์„ฑ๊ณตํ•˜์…จ๋‹ค๋‹ˆ ๋‹คํ–‰์ž…๋‹ˆ๋‹ค. Windows ๋ฌธ์ œ์— ๋Œ€ํ•ด ์œ ๊ฐ์Šค๋Ÿฝ๊ฒŒ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค(Windows๊ฐ€ ๊ฐ€์žฅ ํฐ ๋ฌธ์ œ ์›์ธ์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค). ์ง€๊ธˆ์€ ๋ฌธ์ œ๋ฅผ ์—ด์–ด ๋‘๊ฒ ์Šต๋‹ˆ๋‹ค. ํŒ€์˜ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค ์ค‘ ์ผ๋ถ€๋Š” ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ๋Š” Windows ์‹œ์Šคํ…œ์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ Windows ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ฌธ์ œ ๋ณด๊ณ  ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

์˜ํ™”,
๋ถˆํ–‰ํžˆ๋„ win7 64 env์—์„œ ์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.
๋ฌธ์•ˆ ์ธ์‚ฌ
ํ•˜๋ฆฌ

์ด ์‹œ์ ์—์„œ Windows ๊ฒฝํ—˜/์ง€์‹์ด ์žˆ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ ๋„์›€์„ ์š”์ฒญํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋“  ๊ฒƒ์ด Linux ๋ฐ MacOS X(๋‚ด๊ฐ€ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ)์—์„œ ์ž˜ ์ž‘๋™ํ•˜๊ณ , ์ ์–ด๋„ ๋•Œ๋•Œ๋กœ Windows์—์„œ๋Š” ์ž‘๋™ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค... Windows์—์„œ ์ปดํŒŒ์ผํ•œ ๊ฒฝํ—˜์ด ์žˆ๋Š” ์‚ฌ๋žŒ์ด๋ผ๋ฉด ๋ˆ„๊ตฌ๋ผ๋„ ๋„์›€์„ ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

์ฐธ๊ณ ๋กœ; ์ด๊ฒƒ์€ ์‹คํŒจํ•œ ์ตœ๊ทผ pip ์„ค์น˜์ž…๋‹ˆ๊นŒ? ๋„์›€์ด ๋˜๋Š” ๊ฐœ์ธ์ด ์ œ๊ณตํ•œ ๋Œ€๋กœ ์–ผ๋งˆ ์ „ win64์šฉ ํœ  ํŒจํ‚ค์ง€๋ฅผ ์ถ”๊ฐ€ํ•˜๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค. ์•„๋งˆ๋„ ์ด๊ฒƒ์ด ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚จ ๊ฒƒ์ž…๋‹ˆ๊นŒ?

๊ณผ์—ฐ ํ•์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋ฌธ์ œ๋Š” ๋ฒ„์ „ 1.10 ์ด์ƒ์— cython์ด ํ•„์š”ํ•œ numpy ๋•Œ๋ฌธ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. Cython ์„ค์น˜ ์‹œ ์ž˜ ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋น ๋ฅธ ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋จผ์ € cython์„ ์„ค์น˜ํ•œ ๋‹ค์Œ ์šฐ๋ถ„ํˆฌ 16.04์— hdbscan์„ ์„ค์น˜ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค.

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