码迷,mamicode.com
首页 > 编程语言 > 详细

python2.6 使用pip安装django报错

时间:2018-09-08 14:06:13      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:ida   init   1.5   tmp   roo   升级   load   .gz   python2.6   

之前处理过这个问题,因为没有记录,所以第二次踩坑了,所以此次留存处理记录

centos6.5、默认的python2.6、pip1.5.4

安装django

pip install django

执行结果:

Downloading/unpacking django
  Downloading Django-2.1.1.tar.gz (8.6MB): 8.6MB downloaded
  Running setup.py (path:/tmp/pip_build_root/django/setup.py) egg_info for package django
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/django/setup.py", line 32, in <module>
        """.format(*(REQUIRED_PYTHON + CURRENT_PYTHON)))
    ValueError: zero length field name in format
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/django/setup.py", line 32, in <module>

    """.format(*(REQUIRED_PYTHON + CURRENT_PYTHON)))

ValueError: zero length field name in format

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/django
Storing debug log for failure in /root/.pip/pip.log

日志内容:

ValueError: zero length field name in format

----------------------------------------
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/django
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 325, in run_egg_info
    command_desc=python setup.py egg_info)
  File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/django

 怀疑是没装setuptools

install --upgrade pip setuptools

Successfully installed pip setuptools
Cleaning up...

继续安装django尝试....报错

Traceback (most recent call last):
  File "/usr/bin/pip", line 7, in <module>
    from pip._internal import main
  File "/usr/lib/python2.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/lib/python2.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/lib/python2.6/site-packages/pip/_internal/index.py", line 536
    {str(c.version) for c in all_candidates},

这个报错就比较明显了

是python版本问题,因为默认的2.6不支持,最低要求2.7,所以升级2.7之后解决。

 

python2.6 使用pip安装django报错

标签:ida   init   1.5   tmp   roo   升级   load   .gz   python2.6   

原文地址:https://www.cnblogs.com/garyzhuang/p/9607730.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!