问题
I'm trying to install pycairo on kubuntu 13.04, and it's giving me an error complaining about MACOSX_DEPLOYMENT_TARGET:
(virtualenv-3)naught101@naught101-chronos:/tmp/pycairo-1.10.0$ python waf configure
./options()
Setting top to : /tmp/pycairo-1.10.0
Setting out to : /tmp/pycairo-1.10.0/build_directory
./configure()
Checking for 'gcc' (c compiler) : ok
Checking for program python : /home/naught101/.virtualenvs/virtualenv-3/bin/python
Checking for python version : (3, 3, 2, 'final', 0)
Traceback (most recent call last):
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Scripting.py", line 93, in waf_entry_point
run_commands()
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Scripting.py", line 145, in run_commands
run_command(cmd_name)
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Scripting.py", line 138, in run_command
ctx.execute()
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Configure.py", line 124, in execute
super(ConfigurationContext,self).execute()
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Context.py", line 87, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Context.py", line 127, in recurse
user_function(self)
File "/tmp/pycairo-1.10.0/wscript", line 29, in configure
ctx.check_python_headers()
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Configure.py", line 217, in fun
return f(*k,**kw)
File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Tools/python.py", line 131, in check_python_headers
if dct[x]:
KeyError: 'MACOSX_DEPLOYMENT_TARGET'
(virtualenv-3)naught101@naught101-chronos:/tmp/pycairo-1.10.0$
Of course, I'm not on a Mac, so I have no idea why this is appearing. Any ideas?
Edit: build_directory/config.log
:
# project pycairo (1.10.0) configured on Fri Oct 4 20:15:40 2013 by
# waf 1.6.4 (abi 98, python 30302f0 on linux)
# using waf configure
#
----------------------------------------
Setting top to
/tmp/pycairo-1.10.0
----------------------------------------
Setting out to
/tmp/pycairo-1.10.0/build_directory
----------------------------------------
Checking for 'gcc' (c compiler)
find program=['gcc', 'cc'] paths=['/home/naught101/.virtualenvs/virtualenv-3/bin', '/home/naught101/.pyenv/shims', '/home/naught101/.pyenv/bin', '~/bin', '/usr/lib/x86_64-linux-gnu/qt4/bin', '/home/naught101/bin', '/usr/lib/lightdm/lightdm', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/usr/brlcad/bin'] var='CC' -> '/usr/bin/gcc'
find program=['ar'] paths=['/home/naught101/.virtualenvs/virtualenv-3/bin', '/home/naught101/.pyenv/shims', '/home/naught101/.pyenv/bin', '~/bin', '/usr/lib/x86_64-linux-gnu/qt4/bin', '/home/naught101/bin', '/usr/lib/lightdm/lightdm', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/usr/brlcad/bin'] var='AR' -> '/usr/bin/ar'
ok
----------------------------------------
Checking for program python
/home/naught101/.virtualenvs/virtualenv-3/bin/python
find program=['python'] paths=['/home/naught101/.virtualenvs/virtualenv-3/bin', '/home/naught101/.pyenv/shims', '/home/naught101/.pyenv/bin', '~/bin', '/usr/lib/x86_64-linux-gnu/qt4/bin', '/home/naught101/bin', '/usr/lib/lightdm/lightdm', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/usr/brlcad/bin'] var='PYTHON' -> '/home/naught101/.virtualenvs/virtualenv-3/bin/python'
['/home/naught101/.virtualenvs/virtualenv-3/bin/python', '-c', 'import sys\nfor x in sys.version_info: print(str(x))']
out: 3
3
2
final
0
['/home/naught101/.virtualenvs/virtualenv-3/bin/python', '-c', "from distutils.sysconfig import get_python_lib\n\nprint(repr(get_python_lib(standard_lib=0, prefix='/usr/local') or ''))"]
out: '/usr/local/lib/python3.3/site-packages'
['/home/naught101/.virtualenvs/virtualenv-3/bin/python', '-c', "from distutils.sysconfig import get_python_lib\n\nprint(repr(get_python_lib(plat_specific=1, standard_lib=0, prefix='/usr/local') or ''))"]
out: '/usr/local/lib/python3.3/site-packages'
----------------------------------------
Checking for python version
(3, 3, 2, 'final', 0)
['/home/naught101/.virtualenvs/virtualenv-3/bin/python', '-c', "from distutils.sysconfig import get_config_var\n\nprint(repr(get_config_var('prefix') or ''))\nprint(repr(get_config_var('SO') or ''))\nprint(repr(get_config_var('LDFLAGS') or ''))\nprint(repr(get_config_var('LIBDIR') or ''))\nprint(repr(get_config_var('LIBPL') or ''))\nprint(repr(get_config_var('INCLUDEPY') or ''))\nprint(repr(get_config_var('Py_ENABLE_SHARED') or ''))\nprint(repr(get_config_var('MACOSX_DEPLOYMENT_TARGET') or ''))\nprint(repr(get_config_var('LDSHARED') or ''))\nprint(repr(get_config_var('CFLAGS') or ''))"]
out: '/home/naught101/.virtualenvs/virtualenv-3'
'.so'
"-L'/home/naught101/.pyenv/versions/3.3.2/lib'"
'/home/naught101/.pyenv/versions/3.3.2/lib'
'/home/naught101/.pyenv/versions/3.3.2/lib/python3.3/config-3.3m'
'/home/naught101/.pyenv/versions/3.3.2/include/python3.3m'
''
''
"gcc -pthread -shared -L'/home/naught101/.pyenv/versions/3.3.2/lib'"
'-Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes'
Configuration returned from ['/home/naught101/.virtualenvs/virtualenv-3/bin/python']:
"prefix = '/home/naught101/.virtualenvs/virtualenv-3'\nSO = '.so'"
来源:https://stackoverflow.com/questions/19128874/keyerror-macosx-deployment-target-in-waf-on-kubuntu