简体   繁体   中英

pip Install -r requirements.txt error

Error log:

   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')

The project is being reorganized and the requirement.txt is generated 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

I copied your requirement file and executed it with python 2.7 with no problems. I think you should try to rewrite the file from scratch in case there is invisible characters messing with your pip install. Another solution could be to paste your requirement into a basic text editor such as gedit or notepad and then copy them back to your requirement file to try deleting the invisible characters.

If it still does not work, try installing each packages one by one via the command line to find out which one causes the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM