我在我的linux系統上安裝了python 2.7,我試圖通過crontab安排一個python腳本。該腳本工作正常,在命令行中,通過cron運行然而,當我得到:從crontab運行python的問題 - 「無效的Python安裝」
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site.py", line 553, in <module>
main()
File "/usr/local/lib/python2.7/site.py", line 535, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/lib/python2.7/site.py", line 268, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/lib/python2.7/site.py", line 243, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/lib/python2.7/site.py", line 233, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/local/lib/python2.7/sysconfig.py", line 535, in get_config_var
return get_config_vars().get(name)
File "/usr/local/lib/python2.7/sysconfig.py", line 434, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)
我看到/usr/include/python2.7
開不存在,但/usr/local/include/python2.7/
一樣。安裝python時我犯了一個錯誤嗎?
哪個Linux發行版? – 2011-03-18 03:24:24
@Sridhar - Ubuntu – ripper234 2011-03-18 09:57:59
這不會直接回答你的問題,但你有沒有嘗試過ActivePython 2.7 - 安裝到/opt/ActivePython-2.7? – 2011-03-18 17:23:03