python 第一次安装用2.7 实际显示是2.6.6.有原装文件夹有问题.无法运行setuptools

2013-11-14 11:27:17 +08:00
 sincoslong
$ 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
sin@sincoslong.com [~/.local/Python-2.7.6]# vim .pydistutils.cfg
6535 次点击
所在节点    Linux
2 条回复
sincoslong
2013-11-14 11:33:51 +08:00
先安装的2.7 实际是 2.6.6
在安装setuptool遇到问题.决定重新安装.
之前的2.6.6 没有卸载.担心卸不干净.
直接下载2.7.6
按照教程步骤安装.步骤按照这个来的http://www.iteye.com/topic/544806
到编译的时候就出现问题
然后 python 版本没有变.没有安装成功.
现在我该如何?
neoblackcap
2013-11-15 02:08:38 +08:00
显示什么就是什么版本,给我的话就是全部卸掉,然后再装,系统是RH系?还是Debian系啊?用源里面的版本不就好了吗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/89221

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX