在CentOS上安装Python

时间:2014-03-10 17:36:36

标签: python python-2.7 makefile

我有CentOS 6.5。我需要使用altinstall在这台计算机上安装python 2.7.6。所以我从以下链接下载了python:

http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz

解压缩文件。然后使用以下命令

./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

我使用“make”后出现以下错误

File "/home/Python-2.7.6/Lib/site.py", line 548, in <module>
main()
File "/home/Python-2.7.6/Lib/site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "/home/Python-2.7.6/Lib/site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "/home/Python-2.7.6/Lib/site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/home/Python-2.7.6/Lib/site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "/home/Python-2.7.6/Lib/sysconfig.py", line 516, in get_config_var
return get_config_vars().get(name)
File "/home/Python-2.7.6/Lib/sysconfig.py", line 468, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/home/Python-2.7.6/Lib/sysconfig.py", line 352, in _init_posix
from _sysconfigdata import build_time_vars
ImportError: No module named _sysconfigdata
make: *** [sharedmods] Error 1

我该如何解决这个问题?

0 个答案:

没有答案