<p>install_requires ์ง€์‹œ๋ฌธ ๋ฌธ์ œ๋ฅผ ํ†ตํ•œ numpy ์„ค์น˜ (Trac # 1841)</p>

์— ๋งŒ๋“  2012๋…„ 10์›” 20์ผ  ยท  39์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: numpy/numpy

_2011-05-25 trac ์‚ฌ์šฉ์ž ohe์˜ ์›๋ณธ ํ‹ฐ์ผ“ http://projects.scipy.org/numpy/ticket/1841 , unknown์— ํ• ๋‹น ๋จ _

์•ˆ๋…•ํ•˜์‹ญ๋‹ˆ๊นŒ,

virtualenv์—์„œ python v2.7.1์„ ์‚ฌ์šฉํ•˜๋ฉด setuptools / distribute์˜ install_requires ์ง€์‹œ๋ฌธ์„ ํ†ตํ•ด numpy๋ฅผ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

from setuptools import setup
setup(...
      install_requires=['numpy'],
      ...)

python setup.py install ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํŠธ๋ ˆ์ด์Šค ๋ฐฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

running install
running bdist_egg
running egg_info
writing requirements to UNKNOWN.egg-info/requires.txt
writing UNKNOWN.egg-info/PKG-INFO
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

creating build/bdist.macosx-10.6-intel
creating build/bdist.macosx-10.6-intel/egg
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying UNKNOWN.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying UNKNOWN.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying UNKNOWN.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying UNKNOWN.egg-info/requires.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying UNKNOWN.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/UNKNOWN-0.0.0-py2.7.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing UNKNOWN-0.0.0-py2.7.egg
Copying UNKNOWN-0.0.0-py2.7.egg to /Users/olivier/tc/karmatest/lib/python2.7/site-packages
Adding UNKNOWN 0.0.0 to easy-install.pth file

Installed /Users/olivier/tc/karmatest/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
Processing dependencies for UNKNOWN==0.0.0
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://numeric.scipy.org
Best match: numpy 1.6.0
Downloading http://sourceforge.net/projects/numpy/files/NumPy/1.6.0/numpy-1.6.0.tar.gz/download
Processing download
Running numpy-1.6.0/setup.py -q bdist_egg --dist-dir /var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/egg-dist-tmp-Zr2lMr
Running from numpy source directory.Warning: distutils distribution has been initialized, it may be too late to add a subpackage commandWarning: distutils distribution has been initialized, it may be too late to add a subpackage fcompilernon-existing path in '/private/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils': 'site.cfg'
Warning: distutils distribution has been initialized, it may be too late to add a subpackage distutilsWarning: distutils distribution has been initialized, it may be too late to add a subpackage testingWarning: distutils distribution has been initialized, it may be too late to add a subpackage f2pyWarning: distutils distribution has been initialized, it may be too late to add an extension _sortWarning: distutils distribution has been initialized, it may be too late to add an extension multiarrayWarning: distutils distribution has been initialized, it may be too late to add an extension umathWarning: distutils distribution has been initialized, it may be too late to add an extension scalarmathWarning: distutils distribution has been initialized, it may be too late to add an extension _dotblasWarning: distutils distribution has been initialized, it may be too late to add an extension umath_testsWarning: distutils distribution has been initialized, it may be too late to add an extension multiarray_testsWarning: distutils distribution has been initialized, it may be too late to add a subpackage coreWarning: distutils distribution has been initialized, it may be too late to add an extension _compiled_baseWarning: distutils distribution has been initialized, it may be too late to add a subpackage libWarning: distutils distribution has been initialized, it may be too late to add a subpackage oldnumericWarning: distutils distribution has been initialized, it may be too late to add an extension _capiWarning: distutils distribution has been initialized, it may be too late to add a subpackage numarrayWarning: distutils distribution has been initialized, it may be too late to add an extension fftpack_liteWarning: distutils distribution has been initialized, it may be too late to add a subpackage fftWarning: distutils distribution has been initialized, it may be too late to add an extension lapack_liteWarning: distutils distribution has been initialized, it may be too late to add a subpackage linalgWarning: distutils distribution has been initialized, it may be too late to add an extension mtrandWarning: distutils distribution has been initialized, it may be too late to add a subpackage randomWarning: distutils distribution has been initialized, it may be too late to add a subpackage maWarning: distutils distribution has been initialized, it may be too late to add a subpackage matrixlibWarning: distutils distribution has been initialized, it may be too late to add a subpackage compatWarning: distutils distribution has been initialized, it may be too late to add a subpackage polynomialWarning: distutils distribution has been initialized, it may be too late to add a subpackage docWarning: distutils distribution has been initialized, it may be too late to add a subpackage numpyCould not locate executable f95
Could not locate executable f90
Could not locate executable f77
Could not locate executable xlf90
Could not locate executable xlf
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable g77
Found executable /usr/local/bin/gfortran
_configtest.c:1: warning: conflicting types for built-in function โ€˜expโ€™
_configtest.c:1: warning: conflicting types for built-in function โ€˜expโ€™
_configtest.c:1:20: error: Python.h: No such file or directory
_configtest.c:1:20: error: Python.h: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-//ccLgEqLk.out
_configtest.c:1:20: error: Python.h: No such file or directory
_configtest.c:1:20: error: Python.h: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-//ccLgEqLk.out
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    install_requires=['numpy']
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 76, in run
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 104, in do_egg_install
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 427, in easy_install
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 478, in install_item
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 519, in process_distribution
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 563, in resolve
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 799, in best_match
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 811, in obtain
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 476, in install_item
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 62, in run_setup
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 105, in run
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 64, in <lambda>
  File "setup.py", line 196, in <module>

  File "setup.py", line 189, in setup_package

  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/core.py", line 186, in setup
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/olivier/tc/karmatest/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/bdist_egg.py", line 167, in run
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/command/egg_info.py", line 8, in run
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/command/build_src.py", line 152, in run
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/command/build_src.py", line 169, in build_sources
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/command/build_src.py", line 328, in build_extension_sources
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/command/build_src.py", line 385, in generate_sources
  File "/private/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/core/setup.py", line 410, in generate_config_h

  File "/private/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/core/setup.py", line 41, in check_types

  File "/private/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/core/setup.py", line 271, in check_types

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/misc_util.py:251: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/misc_util.py", line 251, in clean_up_temporary_directory
ImportError: No module named numpy.distutils
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/var/folders/Iy/Iyse1OVUE38-IcPmyTb65E+++TI/-Tmp-/easy_install-W5KwbN/numpy-1.6.0/numpy/distutils/misc_util.py", line 251, in clean_up_temporary_directory
ImportError: No module named numpy.distutils

virtualenv ๋‚ด๋ถ€ ๋˜๋Š” ์™ธ๋ถ€์— pip install numpy ๋˜๋Š” easy_install numpy numpy๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐ ๋ฌธ์ œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

์šด์˜์ฒด์ œ : Mac OS 10.6.7

00 - Bug Other

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

setuptools ์˜ ์ตœ์‹  ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜์—ฌ์ด ๋ฌธ์ œ๋ฅผ ๊ฒฝํ—˜ํ•˜๋Š” ๋ชจ๋“  ์‚ฌ๋žŒ์„์œ„ํ•œ FYI๋กœ์„œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ NumPy๋ฅผ setup_requires ์ž…๋‹ˆ๋‹ค. ์—ฌ์ „ํžˆ install_requires ์— ๋ณด๊ด€ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— setup.py ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

setup(
...
    setup_requires=["numpy"],
    install_requires=["numpy"],
)

์ด๊ฒƒ์€ ์ž‘๋™ํ•˜๋ฉฐ Mac OS X ๋ฐ Linux ๋ชจ๋‘์—์„œ NumPy๋ฅผ ํ•œ ๋ฒˆ๋งŒ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค (Windows์—์„œ๋Š” ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์Œ).

๋‚ด๊ฐ€ ์™œ ๋‹จ์„œ๊ฐ€ ์—†๋Š”์ง€.

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

_ @ rgommers์ด (๊ฐ€) 2011-05-27์— ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค

๋ฌธ์ œ๊ฐ€ ์ •ํ™•ํžˆ ๋ฌด์—‡์ธ์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ๋จผ์ € numpy๋ฅผ ์„ค์น˜ ํ•œ ๋‹ค์Œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๋Š” ์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์ด๋Ÿฌํ•œ ์ž˜๋ชป ๋ฌธ์„œํ™” ๋œ setuptools ๊ธฐ๋Šฅ์— ์˜์กดํ•˜๋Š” ๊ฒƒ์€ ํ”ผํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ์ข‹์€ ์ƒ๊ฐ์ด ์•„๋‹™๋‹ˆ๋‹ค.

์ถ”์ธกํ•ด์•ผํ•œ๋‹ค๋ฉด, ์ฒ˜์Œ์œผ๋กœ setuptools.setup ()์„ ํ˜ธ์ถœํ•˜๋ฉด numpy.distutils์— ๋ฌด์–ธ๊ฐ€๋ฅผ ๋ง์น˜๋Š” ๋งˆ๋ฒ•์„ ๋ถˆ๋Ÿฌ ์ผ์œผ ํ‚ต๋‹ˆ๋‹ค.

Running from numpy source directory.Warning: distutils distribution has been
initialized, it may be too late to add a subpackage commandWarning: distutils
distribution has been initialized, it may be too late to add a subpackage

์ด ๊ฒฝ๊ณ ๋Š” distutils / misc_util.py์—์„œ ๋‚˜์˜ต๋‹ˆ๋‹ค.

_trac ์‚ฌ์šฉ์ž ijstokes ๋‹˜์ด 2011-06-08์— ์ž‘์„ฑํ•˜์…จ์Šต๋‹ˆ๋‹ค.

๋‚˜๋Š” ๋ฐฉ๊ธˆ์ด ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์—ˆ๊ณ  ๋‚˜์—๊ฒŒ๋Š” ์ข…์†์„ฑ ๋ฌธ์ œ๋กœ ์ธํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ๋ชจ๋“ˆ๊ณผ ํ•จ๊ป˜ easy_install์„ ๋‹ค์‹œ ์‹œ๋„ํ•˜๋ฉด ๋‘ ๋ฒˆ์งธ๋กœ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๋‚ด ์ถ”์ธก์œผ๋กœ๋Š” easy_install ์„ธ์…˜์ด ์ข…๋ฃŒ ๋œ ํ›„์— ๋งŒ โ€‹โ€‹์ผ๋ถ€ ์ข…์†์„ฑ์ด "ํ‘œ์‹œ"๋œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด์•ˆ

์–ด๋Š ์‹œ์ ์—์„œ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์ด๋กœ ์ธํ•ด ๋น„ IHMO๊ฐ€ ์žˆ์–ด์•ผํ•˜๋Š” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. setup.py์˜ install_requires ์˜ต์…˜์—์„œ numpy๋ฅผ ์ง€์ •ํ•  ์ˆ˜์žˆ๋Š” ์ง€์ ์— ๋„๋‹ฌํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก  ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ๋ฌธ์ œ๋ฅผ ์ง„์ •์œผ๋กœ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด ์‹œ๊ฐ„์„ ํˆฌ์žํ•˜๊ณ  ๊นจ๋—ํ•œ ์ˆ˜์ •์„ ์ œ์ถœํ•œ๋‹ค๋ฉด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๊ฐœ์ธ์ ์œผ๋กœ ๊ทธ๊ฒƒ์€ ๋‚˜์—๊ฒŒ prio๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. install_requires ๋Š” ํ”ผํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค (์ ์–ด๋„ ํŒจํ‚ค์ง€๋ฅผ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•  ๋•Œ pip์™€ easy_install์ด ์ข…์†์„ฑ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์ค‘์ง€ ํ•  ๋•Œ๊นŒ์ง€).

์ตœ์‹  distutils / setuptools / pip์—์„œ๋„ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๊ณ„์† ๋ฐœ์ƒํ•˜๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค.

๋‚ด iPad์—์„œ ๋ณด๋ƒ„

2013 ๋…„ 11 ์›” 29 ์ผ 7:22์— njsmith [email protected] ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ผ์Šต๋‹ˆ๋‹ค.

ํ˜„๋Œ€์—์„œ๋„ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ์—ฌ์ „ํžˆ ๋ฐœ์ƒํ•˜๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?
distutils / setuptools / pip?

โ€”
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ํšŒ์‹ ํ•˜๊ฑฐ๋‚˜์—์„œ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.
Gi tHubhttps : //github.com/numpy/numpy/issues/2434#issuecomment -29485806
.

์ด ๋ฌธ์ œ๋ฅผ ๋งŒ๋‚ฌ์œผ๋ฏ€๋กœ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. install_requires ์˜ต์…˜

์šด์˜์ฒด์ œ : Mac 10.8.3

์ด ๋ฌธ์ œ์— ๋ถ€๋”ช ํ˜”์Šต๋‹ˆ๋‹ค. ์‡ผ๊ฐ€ ๋ฉˆ์ถ”์ง€ ์•Š์•˜์ง€๋งŒ ํ™•์‹คํžˆ ์งœ์ฆ๋‚ฉ๋‹ˆ๋‹ค. ํŠนํžˆ ์‚ฌ์šฉ์ž / ํ™˜๊ฒฝ ๋ฌธ์ œ ๋ผ๊ธฐ๋ณด๋‹ค๋Š” ๋ฒ„๊ทธ๋ผ๋Š” ๊ฒƒ์ด ๋ถ„๋ช…ํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋งŒ๋“  2.7 virtualenv์— pandas ( install_requires )๋ฅผ ์„ค์น˜ํ•˜์—ฌ์ด๋ฅผ ์žฌํ˜„ ํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

$ virtualenv --no-site-packages nonumpy
$ source nonumpy/bin/activate
$ cd $PANDAS_DIR
$ pip install cython # needed for pandas
$ python setup.py install

๋ˆ„๊ตฐ๊ฐ€ ์ด๊ฒƒ์„ ์žฌํ˜„ํ•˜๋Š” ์‰ฌ์šด ๋ฐฉ๋ฒ•์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค๋ฉด ๋„์›€์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

2.7 ๊ฐ€์ƒ ํ™˜๊ฒฝ์—์„œ๋„์ด ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. os ์šฐ๋ถ„ํˆฌ wheezy

@zethraeus (์œ„์˜ ๋‚ด ์˜๊ฒฌ์—์„œ์™€ ๊ฐ™์ด) ์ด๊ฒƒ์„ ์žฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ์ผ๋ จ์˜ ๋ช…๋ น์„ ์ œ๊ณต ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ ํ•  ์ˆ˜์—†๋Š” ๊ฒฝ์šฐ ์ˆ˜์ •ํ•˜๊ธฐ๊ฐ€ ์–ด๋ ต์Šต๋‹ˆ๋‹ค.

์•ˆ๋…•ํ•˜์„ธ์š”! ๋„ˆ๋ฌด ์˜ค๋ž˜ ๊ฑธ๋ ค์„œ ๋ฏธ์•ˆํ•˜์ง€๋งŒ ์—ฌ๊ธฐ ์žฌ์ƒ์‚ฐ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ฐธ์กฐ : https://gist.github.com/kejbaly2/71517b08536776399198

@ kejbaly2 ์˜ˆ์ œ ๋•๋ถ„์— ์ง€๊ธˆ ์žฌํ˜„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

SO์— ๋Œ€ํ•œ ๋™์ผํ•œ ๋ฌธ์ œ :
http://stackoverflow.com/questions/20356725/error-installing-numpy-via-setup-tools-in-virtualenv-on-ubuntu
http://stackoverflow.com/questions/19904957/installing-numpy-as-a-dependency-in-setup-py

๊ทธ๋ฆฌ๊ณ  Red Hat ๋ฒ„๊ทธ ์ถ”์ ๊ธฐ : https://bugzilla.redhat.com/show_bug.cgi?id=1019924

pip ๊ฐ€ ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜์ง€๋งŒ setuptools ์™€ ๊ด€๋ จ์ด์—†๋Š” install_requires : https://bitbucket.org/pypa/setuptools/issue/209/setup_requires-and-install_requires- ํ•˜์ง€๋งˆ

install_requires ๋ฐ numpy๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ๋งค์šฐ ์œ ์‚ฌํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

Red Hat 6.5์—์„œ ์˜ค๋ฅ˜๋ฅผ ์žฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
https://gist.github.com/necrolyte2/530e9b39dcb0259b69d4

setuptools ์˜ ์ตœ์‹  ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜์—ฌ์ด ๋ฌธ์ œ๋ฅผ ๊ฒฝํ—˜ํ•˜๋Š” ๋ชจ๋“  ์‚ฌ๋žŒ์„์œ„ํ•œ FYI๋กœ์„œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ NumPy๋ฅผ setup_requires ์ž…๋‹ˆ๋‹ค. ์—ฌ์ „ํžˆ install_requires ์— ๋ณด๊ด€ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— setup.py ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

setup(
...
    setup_requires=["numpy"],
    install_requires=["numpy"],
)

์ด๊ฒƒ์€ ์ž‘๋™ํ•˜๋ฉฐ Mac OS X ๋ฐ Linux ๋ชจ๋‘์—์„œ NumPy๋ฅผ ํ•œ ๋ฒˆ๋งŒ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค (Windows์—์„œ๋Š” ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์Œ).

๋‚ด๊ฐ€ ์™œ ๋‹จ์„œ๊ฐ€ ์—†๋Š”์ง€.

Astropy ์ž์ฒด๊ฐ€ ๋‹ค๋ฅธ ํŒจํ‚ค์ง€์˜ setup_requires ๋กœ ์„ค์น˜ ๋  ๋•Œ Astropy์—์„œ setup_requires=['Numpy'] ๋ฅผ ํ†ตํ•ด Numpy์˜ ๋นŒ๋“œ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ ๊ฐ€๋” ๋ฐœ์ƒํ•  ์ˆ˜์žˆ๋Š” ์œ ์‚ฌํ•œ ๋ฌธ์ œ๋ฅผ ์ถ”์ ํ•˜๋ ค๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค

๋‚˜๋Š” ๊ทธ๊ฒƒ์„์ด ๊ณ ๋Œ€ (๊ทธ๋Ÿฌ๋‚˜ ์›์น™์ ์œผ๋กœ ์—ฌ์ „ํžˆ ๊ด€๋ จ์„ฑ์ด ์žˆ์ง€๋งŒ ์ ์–ด๋„ ์•ฝ๊ฐ„ ๊ด€๋ จ์ด ์žˆ๋Š”๊ฐ€?) ์ฝ”๋“œ ๋น„ํŠธ๋ฅผ ์ถ”์ ํ–ˆ๋‹ค : https://github.com/numpy/numpy/blob/9fc077332b34a7b2a90126f5ae6cc50d57162db5/numpy/distutils/core.py#L92

๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ Numpy์˜ setup.py๋ฅผ ์‹คํ–‰ํ•  ๋•Œ configuration ์— ๋Œ€ํ•œ kwargs์— numpy.distutils.core.setup configuration ๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ๋„ฃ์Šต๋‹ˆ๋‹ค. numpy.distutils.core.setup ๋Š” ์„ค์ • kwargs์—์„œ 'configuration' ํ‚ค๋ฅผ ํŒํ•œ ๋‹ค์Œ distutils.core "๋งˆ๋ฒ•์˜"์ „์—ญ ๋ณ€์ˆ˜๋ฅผ ์„ค์ • ํ•œ ๋‹ค์Œ _itself_๋ฅผ ์žฌ๊ท€ ์ ์œผ๋กœ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค . ์ด ์žฌ๊ท€ ํ˜ธ์ถœ์˜ ๋ชฉ์ ์€ distutils ๊ธฐ๊ณ„๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์˜ค๋ฅ˜ /-help์— ๋Œ€ํ•œ ๋ช…๋ น ์ค„ ์ธ์ˆ˜๋ฅผ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๊ทธ๋Ÿฐ ๋‹ค์Œ ๋ชจ๋“  Numpy ํ•˜์œ„ ํŒจํ‚ค์ง€๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹œ์ž‘ ํ•˜๋Š” configuration ํ•จ์ˆ˜ ๋ฅผ ํ˜ธ์ถœ ํ•œ ๋‹ค์Œ, ์ด์ œ ๋ชจ๋“  ํŒจํ‚ค์ง€๊ฐ€ ์™„์ „ํžˆ ๊ตฌ์„ฑ๋˜์–ด์žˆ๋Š” distutils setup() ํ•จ์ˆ˜๋ฅผ ๋‹ค์‹œ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ชจ๋“  ๊ฒƒ์ด ์ž˜๋ชป ์‹คํ–‰๋˜๋Š” ๊ฒฝ์šฐ Configuration ๊ด€๋ฆฌ์ž ๊ฐ€ Distribution ๊ฐœ์ฒด์— ํ•ญ๋ชฉ์„ ์ฒจ๋ถ€ํ•˜๊ธฐ ์œ„ํ•ด get_distribution ์œ ํ‹ธ๋ฆฌํ‹ฐ๋ฅผ ํ˜ธ์ถœํ•ด์•ผํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์— ๋Œ€ํ•œ ํ•„์š”์„ฑ์€ ๋…ผ์Ÿ์˜ ์—ฌ์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค,์˜ ์ฝ”๋“œ์˜ ์ผ๋ถ€๊ฐ€์žˆ๋Š” ๋™์•ˆ Configuration ๊ฐ€์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ ํ•  ์ˆ˜ ์žˆ์–ด์•ผํ•ฉ๋‹ˆ๋‹ค ์ƒ๊ฐ, ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ๋ผ๊ณ  ์ƒ๊ฐ ๋‹ค๋ฅธ ๋ถ€๋ถ„์ด ์žˆ์Šต๋‹ˆ๋‹ค Distribution ์ธ์Šคํ„ด์Šค์— ์—ฐ๊ฒฐ distutils.core._setup_distribution ๊ทธ๋Ÿฌ๋ฉด ๋ญ”๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค (๋”ฐ๋ผ์„œ ์ผ๋ถ€ ์‚ฌ๋žŒ๋“ค์ด์ด ์Šค๋ ˆ๋“œ์—์„œ๋ณด๊ณ  ํ•œ "distutils ๋ฐฐํฌ๊ฐ€ ์ดˆ๊ธฐํ™”๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ•˜์œ„ ํŒจํ‚ค์ง€๋ฅผ ์ถ”๊ฐ€ํ•˜๊ธฐ์—๋Š” ๋„ˆ๋ฌด ๋Šฆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค"๊ฒฝ๊ณ ).

์•ฝ๊ฐ„ ๋ฐฑ์—…ํ•˜๊ณ  ๋ช…ํ™•ํ•˜๊ฒŒํ•˜๊ธฐ ์œ„ํ•ด distutils (๋˜๋Š” setuptools)์—์„œ setup() ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•  ๋•Œ setup() kwargs์—์„œ Distribution ๊ฐœ์ฒด๋ฅผ ์ดˆ๊ธฐํ™” ํ•œ ๋‹ค์Œ ๊ฒฐ๊ณผ Distribution ๋Š” ์ „์—ญ ๋ณ€์ˆ˜ distutils.core._setup_distribution ์ž…๋‹ˆ๋‹ค. ํ˜„์žฌ ํŒŒ์ด์ฌ ์ธํ„ฐํ”„๋ฆฌํ„ฐ์—์„œ ์‹คํ–‰๋  _only_ ์„ค์ •์ด๋ผ๊ณ  ๊ฐ€์ •ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‹ค์ œ๋กœ์ด ๋ณ€์ˆ˜๋ฅผ ์ •๋ฆฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์„ค์ •์„ ์œ„ํ•ด ์„ค๊ณ„๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. (pip๋Š” ์ž์ฒด ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค์—์„œ ๊ฐ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜์—ฌ ์—ฌ๋Ÿฌ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•  ๋•Œ ์ด์™€ ์œ ์‚ฌํ•œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค.) ๊ทธ๋Ÿฌ๋‚˜ setup_requires ์™€ ๊ฐ™์€ ๋‹ค๋ฅธ ๊ฒฝ์šฐ์—๋Š” ์ด๋ฏธ distutils.core._setup_distribution ๋งค๋‹ฌ๋ ค์žˆ๋Š” ๋ฃจํŠธ ํŒจํ‚ค์ง€์˜ Distribution ์ธ์Šคํ„ด์Šค๊ฐ€์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ Numpy์˜ Configuration ํด๋ž˜์Šค๊ฐ€ _Numpy ์ž์ฒด _์— ๋Œ€ํ•œ Distribution ๊ฐœ์ฒด์— ํ•ญ๋ชฉ์„ ์ฒจ๋ถ€ํ•˜๋ ค๊ณ ํ•˜๋ฉด ์–ด๋–ค ๊ฒฝ์šฐ์—๋Š” ์ž˜๋ชป๋œ Distribution ์™€ (๊ณผ) ์—‰๋ง์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ์ผ๋ถ€ ๋น„ํŠธ๊ฐ€ ๋ˆ„๋ฝ๋˜์–ด Numpy ๋นŒ๋“œ๊ฐ€ ๋ง๊ฐ€์ง‘๋‹ˆ๋‹ค.

setuptools ๋ ๋ฐ / ๋˜๋Š” Numpy ๋ ๋ชจ๋‘์—์„œ ์ด์— ๋Œ€ํ•œ ๊ฐ€๋Šฅํ•œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ๋งŽ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋‚˜๋Š” ์ตœ์„ ์˜ ์ ‘๊ทผ๋ฒ•์ด ๋ฌด์—‡์ธ์ง€ ๊ฒฐ์ •ํ•˜์ง€ ์•Š์•˜์ง€๋งŒ ๋ชจ๋“  ๊ฒƒ์ด ํ™•์‹คํžˆ ์—‰๋ง์ž…๋‹ˆ๋‹ค. :)

๊ฐ€์น˜๋ฅผ ์œ„ํ•ด setuptools ๋์—์„œ ๊ฐ€๋Šฅํ•œ ํ•œ ๊ฐ€์ง€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ setuptools๊ฐ€ ์„ค์ •์„ ๋‹ฌ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ํ•จ์ˆ˜ ์ธ setuptools.sandbox.run_setup ์— ๋Œ€ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์„ค์ •์„ ์‹คํ–‰ํ•˜๊ธฐ ์ „ / ํ›„์— ๋ชจ๋“  distutils.core ์ „์—ญ ๋ณ€์ˆ˜๋ฅผ ์ €์žฅ / ๋ณต์›ํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ œ์˜ ์Šคํฌ๋ฆฝํŠธ.

ํ˜„์žฌ ๋ฒ„์ „์˜ setuptools๋Š” ์ž์‹ setup.py ์Šคํฌ๋ฆฝํŠธ๋ฅผ ํ˜ธ์ถœํ•˜๊ธฐ ์ „์— ์›๋ž˜ distutils.core ( sys.modules ์—์„œ ์ œ๊ฑฐ)๋ฅผ ์ˆจ๊ฒจ์„œ ์ด๋ฏธ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๊ฒŒ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•ด์š”. ๊ทธ๋Ÿฌ๋‚˜ ๋‚˜๋Š” ์ด๊ฒƒ์„ ๋‘ ๋ฒˆ ํ™•์ธํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

์—…๋ฐ์ดํŠธ : ํ™•์ธ, ์œ„์—์„œ ์„ค๋ช…ํ•œ ๋ฌธ์ œ๋Š” setuptools> = 10.0์—์„œ (๋‹ค์†Œ ํ–‰๋ณตํ•œ ์šฐ์—ฐ์œผ๋กœ) ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

@embray ํƒ์ • ์ž‘์—…์˜ ์ข‹์€ ๋น„ํŠธ์ž…๋‹ˆ๋‹ค! (๊ทธ๋ฆฌ๊ณ  ๊ทธ๊ฒƒ์€ ๋‚ด ๋จธ๋ฆฌ๋ฅผ ์กฐ๊ธˆ ์•„ํŒŒ์š” :))

๋‹น์‹ ์€ easy_install -๊ทธ๋ž˜์„œ get_distribution() -์šฐ๋ฆฌ๊ฐ€ ๊ทธ๊ฒƒ์„ ๊นจ์ง€ ๋ง์•„์•ผ ํ• ๋งŒํผ ์ถฉ๋ถ„ํžˆ ๊ด€๋ จ์„ฑ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

@rgommers ๋ฌธ์ œ๋Š” easy_install์— ๋Œ€ํ•œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ์•„์ฃผ ์˜ค๋ž˜ ์ „์— ์ถ”๊ฐ€๋˜์—ˆ์œผ๋ฉฐ ๋” ์ด์ƒ ์™„์ „ํžˆ ํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‚ฌ๋žŒ๋“ค์ด ๊ทธ๊ฒƒ์„ ์‚ฌ์šฉํ•ด์•ผํ•˜๋Š” ๋ช‡ ๊ฐ€์ง€ ์ข‹์€ ์ด์œ ). ๋‹ค๋ฅธ ์ƒํ™ฉ์—์„œ๋Š” ๋ฌธ์ œ๊ฐ€๋˜์ง€ ์•Š์œผ๋ฉด ์„œ ์›๋ž˜ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ํŒจ์น˜๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ๋Š”์ง€ ์‚ดํŽด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

@embray๋Š” ์ข‹์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํŒจ์น˜๋ฅผ ์ค€๋น„ํ–ˆ๋Š”๋ฐ 2 ์ฃผ ์ด๋‚ด์— ๊ฒ€ํ† ๊ฐ€๋˜์ง€ ์•Š์œผ์‹œ๋ฉด ์ œ๋ฐœ ํ‚ฅ ํ•ด์ฃผ์„ธ์š” (๋ถ€๋“œ๋Ÿฝ๊ฒŒ)

setup_requires = [ "numpy"]๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์ด ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

AttributeError : '๋ชจ๋“ˆ'๊ฐœ์ฒด์— 'get_include'์†์„ฑ์ด ์—†์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ "python setup.py install"์„ ๋‘ ๋ฒˆ ์‹คํ–‰ํ•˜๋ฉด ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. http://stackoverflow.com/questions/21605927/why-doesnt-setup-requires-work-properly-for-numpy ์ฐธ์กฐ

๋ฐฉ๊ธˆ @asmaier๊ฐ€๋ณด๊ณ  ํ•œ ๋ฌธ์ œ๋ฅผ ๋งŒ๋‚ฌ์Šต๋‹ˆ๋‹ค.

๊ทธ๋งŒํ•œ ๊ฐ€์น˜๊ฐ€ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‚˜๋Š”์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ์œ„ํ•œ ๋‚ด ์•„์ด๋””์–ด๋ฅผ ๊ฒฐ์ฝ” ์žŠ์ง€ ์•Š์•˜์ง€๋งŒ ์ง€๊ธˆ ๋‹น์žฅ ๋‹ค๋ฅธ ๊ฒƒ์— ์ง‘์ค‘ํ•ด์•ผํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์‚ฌ๋žŒ์ด ๊ทธ๊ฒƒ์„ ์ฐŒ๋ฅด๊ณ  ์‹ถ๋‹ค๋ฉด, ๋‚˜๋Š” ๊ทธ๋“ค์ด ์–ด๋””๋กœ ๊ฐˆ์ง€์— ๋Œ€ํ•œ ๋†’์€ ์ˆ˜์ค€์˜ ๊ถŒ์žฅ ์‚ฌํ•ญ์„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ ๋ช‡ ๊ฐ€์ง€ ์˜๊ฒฌ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ์ด ๋ฌธ์ œ๋Š” __builtins__.__NUMPY_SETUP__ = True ์ด ์„ค์ •๋˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
์ข…์†์„ฑ์œผ๋กœ numpy๊ฐ€ ํ•„์š”ํ•œ ์ข…์†์„ฑ์„ ์„ค์น˜ํ•  ๋•Œ __NUMPY_SETUP__ ๋Š” setuptools์— ์˜ํ•ด ์žฌ์„ค์ •๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
์—ฌ๊ธฐ์— __NUMPY_SETUP__ = False ์„ ์„ค์ •ํ•˜๋ ค๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
https://github.com/numpy/numpy/blob/055056a3108ab19883e50ac125ab9974823498c7/numpy/distutils/misc_util.py#L2195
๊ทธ๋Ÿฌ๋‚˜์ด ์ฝ”๋“œ์—๋Š” ๋„๋‹ฌํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.

์‹ค์ œ๋กœ ์ „์ฒด isbootstrapping ํ•จ์ˆ˜๊ฐ€ __builtins__ ์˜ค์šฉ / ๋‚จ์šฉํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. numpy๋ฅผ ์ข…์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  numpy๋ฅผ ์ข…์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•  ๋•Œ ์ค‘๋‹จ๋˜๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.

@JensTimmerman ๋‚˜๋Š” ์ด๊ฒƒ์ด https://github.com/matplotlib/matplotlib/issues/6928 ๊ณผ๋„ ๊ด€๋ จ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ์ ์ ˆํ•œ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ œ์•ˆ์„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค.

@rgommers ์ƒ๊ฐ?

์—ฌ๊ธฐ์—์„œ NUMPY_SETUP = False๋ฅผ ์„ค์ •ํ•˜๋ ค๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
https://github.com/numpy/numpy/blob/055056a3108ab19883e50ac125ab9974823498c7/numpy/distutils/misc_util.py#L2195
๊ทธ๋Ÿฌ๋‚˜์ด ์ฝ”๋“œ์—๋Š” ๋„๋‹ฌํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.

is_bootstrapping ํ•จ์ˆ˜๋Š” ๋ณด์ด๋Š” ๊ณณ์—์„œ ์‚ฌ์šฉ๋˜์ง€ ์•Š์œผ๋ฏ€๋กœ ๊ด€๋ จ์ด ์—†์Šต๋‹ˆ๋‹ค.

์‹ค์ œ๋กœ, ์ „์ฒด isbootstrapping ํ•จ์ˆ˜๊ฐ€ ์—ฌ๊ธฐ์—์„œ ๋‚ด์žฅ ๊ธฐ๋Šฅ์„ ์˜ค์šฉ / ๋‚จ์šฉํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๋ฏฟ์Šต๋‹ˆ๋‹ค. numpy๋ฅผ ์ข…์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  numpy๋ฅผ ์ข…์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•  ๋•Œ ๊นจ์ง€๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.

__builtins__ ์˜ ์œ ์ผํ•œ ์‚ฌ์šฉ์€ ์—ฌ๊ธฐ ์˜ ๊ธฐ๋ณธ setup.py ์ž…๋‹ˆ๋‹ค.

์ถ”์•…ํ•˜์ง€๋งŒ ๋” ๊ฐ•๋ ฅํ•œ ๋ฐฉ์‹์œผ๋กœ ์ž‘์„ฑํ•˜๊ธฐ๋„ ์–ด๋ ต์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ๋‚ด ์ƒ๊ฐ์— ์ด๊ฒƒ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์œผ๋ฉด install_requires ์•„๋‹Œ ์ƒํ™ฉ์— ๋”ฐ๋ผ setup_requires='numpy' ์—๋งŒ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋“ค ์‚ฌ์ด์˜ ์ฐจ์ด์ ์€ pip ๋Š” ์•„์ง ์ฒ˜๋ฆฌ ๋ฐฉ๋ฒ•์„ ๋ชจ๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์ „์ž๊ฐ€ setuptools ํ˜ธ์ถœํ•œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. Scipy์—์„œ๋Š” setup_requires='numpy' ํ•˜์ง€๋งŒ์ด ๋ฌธ์ œ๋Š” ์ „ํ˜€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๊ทธ๊ฒƒ์€ matplotlib์˜ ์„ค์ • ์Šคํฌ๋ฆฝํŠธ์˜ ๊ธฐ๋Šฅ์„ ๋”ํ•œ ๊ฒƒ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

https://github.com/numpy/numpy/issues/2434#issuecomment -77898051์„ ํ†ตํ•ด ๋‹ค์‹œ ์ฝ์œผ๋ฉด ๋ฌธ์ œ์˜ ์›์ธ์„ ์ž˜ ์„ค๋ช…ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. __NUMPY_SETUP__ ์™€ ๊ด€๋ จ์ด ์—†๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค

ํŽธ์ง‘ : ๋˜๋Š” ์–ด๋–ค ๊ฒฝ์šฐ์—๋Š” ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ์–ด๋ ต์Šต๋‹ˆ๋‹ค. pip ๋Š” ์ž˜ ๊ฒฉ๋ฆฌ ๋œ ๋ฐฉ์‹์œผ๋กœ ๋ฌผ๊ฑด์„ ๋นŒ๋“œ / ์„ค์น˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋ฐ˜์ ์œผ๋กœ ์—ฌ๊ธฐ์—๋Š” ๋ฌธ์ œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

setup.py ๋์— del builtins.__NUMPY_SETUP__ ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ์ด ์ด๋ก ์˜ ์˜ณ๊ณ  ๊ทธ๋ฆ„์„ ์ฆ๋ช…ํ•˜๋Š” ๊ฒƒ์ด ๋„ˆ๋ฌด ์–ด๋ ต์ง€ ์•Š์•„์•ผํ•ฉ๋‹ˆ๋‹ค.

gh-7956์—์„œ ์‹œ๋„ํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

https://github.com/numpy/numpy/issues/2434#issuecomment -49156521์˜ ์š”์ ์ด ์–ด๋Š ์‹œ์ ์—์„œ ์‚ฌ๋ผ์ง€๋Š” ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ ๋‹ค์Œ์€์ด ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์‚ฌ๋ณธ์ž…๋‹ˆ๋‹ค.

cd /tmp

cat > ./setup.py <<DELIM
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: "Chris Ward" <[email protected]>

from setuptools import setup

default_setup = dict(
    name='numpy_install_test',
    description='https://github.com/numpy/numpy/issues/2434',
    provides=['numpy_install_test'],
    install_requires=['pandas'],
    requires=['pandas'],
    license='GPLv3',
    author='Chris Ward',
    author_email='[email protected]',
)   

setup(**default_setup)

DELIM


virtualenv --no-site-packages ~/virtenvs/nonumpy
source ~/virtenvs/nonumpy/bin/activate
python setup.py install

pip install -R requirements.txt๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ python2.7.16์—์„œ pandas๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐ ์–ด๋ ค์›€์„ ๊ฒช์Šต๋‹ˆ๋‹ค.

https://files.pythonhosted.org/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-0.24.2.tar.gz(11.8MB )
python setup.py egg_info ๋ช…๋ น์˜ ์ „์ฒด ์ถœ๋ ฅ :
์—ญ ์ถ”์  (๊ฐ€์žฅ ์ตœ๊ทผ ํ˜ธ์ถœ ๋งˆ์ง€๋ง‰) :
ํŒŒ์ผ "", 1 ํ–‰, in
ํŒŒ์ผ "/tmp/pip-install-WznqHc/pandas/setup.py", ์ค„ 746,
setuptools_kwargs)ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", 144 ํ–‰, ์„ค์ •_install_setup_requires (attrs)_install_setup_requires์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", 139 ํ–‰dist.fetch_build_eggs (dist.setup_requires)fetch_build_eggs์—์žˆ๋Š” ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", 724 ํ–‰replace_conflicting = ์ฐธ,ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", ์ค„ 782, ํ•ด๊ฒฐreplace_conflicting = replace_conflictingํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", 1065 ํ–‰, best_matchreturn self.obtain (req, installer)ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", 1077 ํ–‰, get๋ฐ˜ํ™˜ ์„ค์น˜์ž (์š”๊ตฌ ์‚ฌํ•ญ)fetch_build_egg์˜ "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", 791 ํ–‰ ํŒŒ์ผcmd.easy_install (req) ๋ฐ˜ํ™˜easy_install์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", 679 ํ–‰return self.install_item (spec, dist.location, tmpdir, deps)"/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py"ํŒŒ์ผ, 705 ํ–‰, install_itemdists = self.install_eggs (spec, download, tmpdir)"/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py"ํŒŒ์ผ, 890 ํ–‰, install_eggsreturn self.build_and_install (setup_script, setup_base)build_and_install์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", 1158 ํ–‰self.run_setup (setup_script, setup_base, args)run_setup์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", 1144 ํ–‰run_setup (setup_script, args)run_setup์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 253 ํ–‰์˜ฌ๋ฆฌ๋‹ค__exit__์—์žˆ๋Š” "/usr/local/lib/python2.7/contextlib.py"ํŒŒ์ผ, 35 ํ–‰self.gen.throw (์œ ํ˜•, ๊ฐ’, ์—ญ ์ถ”์ )setup_context์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 195 ํ–‰์ˆ˜์œจ__exit__์—์žˆ๋Š” "/usr/local/lib/python2.7/contextlib.py"ํŒŒ์ผ, 35 ํ–‰self.gen.throw (์œ ํ˜•, ๊ฐ’, ์—ญ ์ถ”์ )save_modules์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 166 ํ–‰saved_exc.resume ()ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 141 ํ–‰, resume์—six.reraise (type, exc, self._tb)save_modules์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 154 ํ–‰์ˆ˜์œจ ์ ˆ์•ฝsetup_context์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 195 ํ–‰์ˆ˜์œจrun_setup์˜ ํŒŒ์ผ "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 250 ํ–‰_execfile (setup_script, ns)_execfile์—์žˆ๋Š” "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", 45 ํ–‰ ํŒŒ์ผexec (์ฝ”๋“œ, ์ „์—ญ, ์ง€์—ญ)** ํŒŒ์ผ "/tmp/easy_install-2M8B7z/numpy-1.17.0rc1/setup.py", 31 ํ–‰,

**RuntimeError: Python version >= 3.5 required.**

python2๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š” numpy-1.17.0rc1์„ ์ฐพ๋Š” ์ด์œ ๋ฅผ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

์–ด๋–ค ๋„์›€์„ ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

requirements.txt ๊ณต์œ ํ•˜์„ธ์š”

์š”๊ตฌ ์‚ฌํ•ญ ํŒŒ์ผ์—๋Š” ๋‹ค์Œ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

ํ”Œ๋ผ์Šคํฌ == 1.0.2
flask-jwt == 0.3.2
ํ”Œ๋ผ์Šคํฌ ์Šคํฌ๋ฆฝํŠธ == 2.0.6
flask-scrypt == 0.1.3.6
PyJWT <1.5.0
๊นœ๋ฐ•์ด == 1.4
phonenumbers == 8.9.12
flanker == 0.9.0
bugsnag == 3.4.3
์ ˆ์ธ b == 0.7.2
์š”์ฒญ == 2.19.1
python-dateutil == 2.8.0
gunicorn == 19.9.0
gevent == 1.3.6
webargs == 4.0.0
ํ”Œ๋ผ์ด == 3.10
bson == 0.5.7
์…€๋Ÿฌ๋ฆฌ == 4.2.1
redis == 3.2.1
๊ณ ์šฉํ•˜๋‹ค
numpy == 1.16.4

๋งˆ์ง€๋ง‰์œผ๋กœ ์š”๊ตฌ ์‚ฌํ•ญ ํŒŒ์ผ ๋‚ด๋ถ€์— numpy๋ฅผ ์œ ์ง€ํ•˜๊ณ  ๋‚˜์ค‘์— pandas๋ฅผ ์„ค์น˜ํ•˜๋„๋ก ๊ด€๋ฆฌํ•˜์‹ญ์‹œ์˜ค.

Docker์—์„œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์‹ญ์‹œ์˜ค.

pip install https://github.com/pydata/pandas/releases/download/v0.24.2/pandas-0.24.2.tar.gz ์‹คํ–‰

๊ทธ๋Ÿฌ๋‚˜ ์ด์ œ ์ปดํŒŒ์ผ์‹œ ํŒ๋‹ค๋ฅผ ์ปดํŒŒ์ผํ•˜๋ ค๋ฉด cython์„ ์„ค์น˜ํ•ด์•ผํ•œ๋‹ค๋Š” ๋˜ ๋‹ค๋ฅธ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ค๋ฅ˜:

์˜ˆ์™ธ : Cython ์ƒ์„ฑ ํŒŒ์ผ 'pandas / io / sas / sas.c'๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
Cython์€ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜์—์„œ pandas๋ฅผ ์ปดํŒŒ์ผํ•˜๋Š” ๋ฐ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
Cython์„ ์„ค์น˜ํ•˜๊ฑฐ๋‚˜ pandas ๋ฆด๋ฆฌ์Šค ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์‹ญ์‹œ์˜ค.

์–ด๋–ค ์ƒ๊ฐ?

install_requires ๋‚ด๋ถ€์—์„œ setup.py install_requires ์‚ฌ์šฉ๊ณผ ๊ด€๋ จ๋œ์ด ๋ฌธ์ œ์™€ ๊ด€๋ จ์ด ์—†์Šต๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด ๋ฌธ์ œ๋ฅผ์—ฌ์‹ญ์‹œ์˜ค. ์†Œ์Šค์—์„œ ํŒฌ๋”๋ฅผ ์„ค์น˜ํ•ด์•ผํ•ฉ๋‹ˆ๊นŒ? pip install pandas==0.24.2 ์•„๋‹Œ ์ด์œ ๋Š” ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?

์˜ˆ, pandas ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ์ด ๋ฌธ์ œ๋ฅผ ์—ด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ pandas๋ฅผ ์ง์ ‘ ์„ค์น˜ํ•  ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— numPy์™€ ๊ด€๋ จํ•˜์—ฌ ์•ž์„œ ์–ธ๊ธ‰ ํ•œ ๊ฒŒ์‹œ๋ฌผ์€ docker env์—์„œ Python2.7์— ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.
pip install pandas == 0.24.2๊ฐ€ ์•„๋‹Œ ์ด์œ ๋Š” ๋ฌด์—‡์ž…๋‹ˆ๊นŒ? ๋„์ปค ์•„๋ž˜์—์„œ ์‹คํ–‰ํ•  ๋•Œ ๋งํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์™ธ : Cython ์ƒ์„ฑ ํŒŒ์ผ 'pandas / msgpack.c'๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
Cython์€ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜์—์„œ pandas๋ฅผ ์ปดํŒŒ์ผํ•˜๋Š” ๋ฐ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
Cython์„ ์„ค์น˜ํ•˜๊ฑฐ๋‚˜ pandas ๋ฆด๋ฆฌ์Šค ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์‹ญ์‹œ์˜ค.

๊ทธ๋ž˜์„œ tarball์—์„œ ์„ค์น˜ํ•˜๋ ค๋ฉด pandas์˜ ๋ฆด๋ฆฌ์Šค ๋ฒ„์ „์„ ์‚ฌ์šฉํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

ํ์‡„. ํŒŒ์ด์ฌ ์„ธ๊ณ„๊ฐ€ setup_requires ๋“ฑ์—์„œ requirements.txt ๋˜๋Š” pyproject.toml ๋กœ ์ด๋™ํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. setup_requires ๋ฅผ ๊ณ„์† ์‚ฌ์šฉํ•˜๋ ค๋Š” ์‚ฌ์šฉ์ž๋ฅผ์œ„ํ•œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

setup(
...
    setup_requires=["numpy"],
    install_requires=["numpy"],
)

@omeryounus ๊ฐ€ python2์— numpy๋ฅผ ์„ค์น˜ํ•˜๋ ค๋Š” ๊ฒฝ์šฐ, ์ด๋Š”์ด ๋ฌธ์ œ์™€ ๊ด€๋ จ์ด์—†๋Š” ๋ณ„๋„์˜ ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค. ์ผ๋ถ€ ์‚ฌ์šฉ์ž๋Š” pip ๋ฐ setuptools๋ฅผ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๊ฒƒ์ด์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ๋‹ค๊ณ ๋ณด๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค.

setup_requires ์— ๋Œ€ํ•ด ๋” ๋…ผ์˜ ํ•  ์‚ฌํ•ญ์ด ์žˆ์œผ๋ฉด ๋‹ค์‹œ์—ฌ์‹ญ์‹œ์˜ค.

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