_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
_ @ 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 ๋ช
๋ น์ ์ ์ฒด ์ถ๋ ฅ :
์ญ ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง) :
ํ์ผ "
ํ์ผ "/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
์ ๋ํด ๋ ๋
ผ์ ํ ์ฌํญ์ด ์์ผ๋ฉด ๋ค์์ฌ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
setuptools
์ ์ต์ ๋ฒ์ ์ ์ฌ์ฉํ์ฌ์ด ๋ฌธ์ ๋ฅผ ๊ฒฝํํ๋ ๋ชจ๋ ์ฌ๋์์ํ FYI๋ก์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ NumPy๋ฅผsetup_requires
์ ๋๋ค. ์ฌ์ ํinstall_requires
์ ๋ณด๊ดํ๊ธฐ ๋๋ฌธ์setup.py
์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.์ด๊ฒ์ ์๋ํ๋ฉฐ Mac OS X ๋ฐ Linux ๋ชจ๋์์ NumPy๋ฅผ ํ ๋ฒ๋ง ์ค์นํฉ๋๋ค (Windows์์๋ ํ ์คํธ๋์ง ์์).
๋ด๊ฐ ์ ๋จ์๊ฐ ์๋์ง.