pip安装-r requirements.txt错误

时间:2015-04-07 13:15:40

标签: python flask pip

错误日志:

   Exception:
    Traceback (most recent call last):
      File "...\env\lib\site-packages\pip\basecommand.py", line 122, in main
        status = self.run(options, args)
      File "...\env\lib\site-packages\pip\commands\install.py", line 262, in run
        for req in parse_requirements(filename, finder=finder, options=options, session=session):
      File "...\env\lib\site-packages\pip\req.py", line 1631, in parse_requirements
        req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
      File "...\env\lib\site-packages\pip\req.py", line 172, in from_line
        return cls(req, comes_from, url=url, prereleases=prereleases)
      File "...\env\lib\site-packages\pip\req.py", line 70, in __init__
        req = pkg_resources.Requirement.parse(req)
      File "...\env\lib\site-packages\pip\_vendor\pkg_resources.py", line 2667, in parse
        reqs = list(parse_requirements(s))
      File "...\env\lib\site-packages\pip\_vendor\pkg_resources.py", line 2593, in parse_requirements
        raise ValueError("Missing distribution spec", line)
    ValueError: ('Missing distribution spec', '\xff\xfeF\x00l\x00a\x00s\x00k\x00=\x00=\x000\x00.\x001\x000\x00.\x001\x00')

正在重组项目,并生成了allow.txt pip freeze> requirements.txt

Requirements.txt

Flask==0.10.1
Flask-SQLAlchemy==1.0
Flask-WTF==0.9.4
Jinja2==2.7.3
MarkupSafe==0.23
SQLAlchemy==0.9.9
WTForms==1.0.5
Werkzeug==0.10.1
itsdangerous==0.24

1 个答案:

答案 0 :(得分:1)

我复制了你的需求文件并使用python 2.7执行它没有任何问题。我认为你应该尝试从头开始重写文件,以防有不可见的字符搞乱你的pip安装。另一个解决方案是将您的需求粘贴到基本文本编辑器(如gedit或notepad)中,然后将它们复制回需求文件以尝试删除不可见的字符。

如果仍然无效,请尝试通过命令行逐个安装每个软件包,找出导致问题的方法。