$ mkdir -p ~/.local/lib/python2.6
$ cd .local
$ wget
http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz $ tar xzvf Python-2.6.4.tgz
$ cd Python-2.6.4
$ ./configure --prefix=$HOME/.local/lib/python2.6
$ make
$ make install
$ cd ~
$ ln -s .local/lib/python2.6/bin/python bin/python2.6
运行[~/.local/setuptools-1.3.2]# easy_install sqlalchemy
Traceback (most recent call last):
File "/usr/bin/easy_install", line 9, in <module>
load_entry_point('distribute==0.6.10', 'console_scripts', 'easy_install')()
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1715, in main
with_ei_usage(lambda:
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1696, in with_ei_usage
return f()
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1719, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib64/python2.6/distutils/core.py", line 126, in setup
dist.parse_config_files()
File "/usr/lib64/python2.6/distutils/dist.py", line 374, in parse_config_files
parser.read(filename)
File "/usr/lib64/python2.6/ConfigParser.py", line 286, in read
self._read(fp, filename)
File "/usr/lib64/python2.6/ConfigParser.py", line 482, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home2/sincoslong/.pydistutils.cfg, line: 1
后来装了2.7.6 make的时候出现错误.也没安装成功.现在版本还是2.6.6 之前python2.7的文件夹被我删掉了.
make错误提示:ibpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/home2/sincoslong/.local/Python-2.7.6/./Modules/posixmodule.c:7545: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/home2/sincoslong/.local/Python-2.7.6/./Modules/posixmodule.c:7492: warning: the use of `tempnam' is dangerous, better use `mkstemp'
./python -E -S -m sysconfig --generate-posix-vars
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "./setup.py", line 2232, in <module>
main()
File "./setup.py", line 2227, in main
'Lib/smtpd.py']
File "/home2/sincoslong/.local/Python-2.7.6/Lib/distutils/core.py", line 125, in setup
dist.parse_config_files()
File "/home2/sincoslong/.local/Python-2.7.6/Lib/distutils/dist.py", line 390, in parse_config_files
parser.read(filename)
File "/home2/sincoslong/.local/Python-2.7.6/Lib/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/home2/sincoslong/.local/Python-2.7.6/Lib/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home2/sincoslong/.pydistutils.cfg, line: 1
'tall] \n'
make: *** [sharedmods] Error 1
[email protected] [~/.local/Python-2.7.6]# vim .pydistutils.cfg