V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
sincoslong
V2EX  ›  Linux

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

  •  
  •   sincoslong · 2013-11-14 11:27:17 +08:00 · 6726 次点击
    这是一个创建于 4024 天前的主题,其中的信息可能已经有所发展或是发生改变。
    $ 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
    2 条回复    1970-01-01 08:00:00 +08:00
    sincoslong
        1
    sincoslong  
    OP
       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
        2
    neoblackcap  
       2013-11-15 02:08:38 +08:00
    显示什么就是什么版本,给我的话就是全部卸掉,然后再装,系统是RH系?还是Debian系啊?用源里面的版本不就好了吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5390 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 08:47 · PVG 16:47 · LAX 00:47 · JFK 03:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.