试图安装Django

时间:2015-01-12 23:00:01

标签: django pip python-3.4

我一直试图正确安装Django一段时间无济于事。

C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\setup.py

引发异常并将以下内容存储在日志文件中:

C:\Python34\Scripts\pip run on 01/12/15 17:47:02
Exception:
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)

  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 257, in run
    InstallRequirement.from_line(name, None))

  File "C:\Python34\lib\site-packages\pip\req.py", line 172, in from_line
    return cls(req, comes_from, url=url, prereleases=prereleases)

  File "C:\Python34\lib\site-packages\pip\req.py", line 70, in __init__
    req = pkg_resources.Requirement.parse(req)

  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2606, in parse
    reqs = list(parse_requirements(s))

  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2544, in parse_requirements
    line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")

  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2512, in scan_list
    raise ValueError("Expected "+item_name+" in",line,"at",line[p:])

ValueError: ('Expected version spec in', 'C:\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py', 'at', ':\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py')

任何帮助将不胜感激! 谢谢你

1 个答案:

答案 0 :(得分:0)

对于pip install,请参阅包含setup.py

的目录
C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\

但是,由于您的路径已经site-packages(例如C:\Python34\Lib\site-packages\),它似乎已经安装

其他替代方案是:

  • pip install django==1.7.2
  • pip install django==1.7
  • python C:...\Django-1.7.2\setup.py install