1

Resolved

requirements.txt in worker role template shouldn't have BOM

description

I don't know about other versions of python/pip, but pip 1.4.1 (the one we install) and python 2.7 have trouble when the requirements.txt has a BOM. Deleting the first 3 bytes of the file in a hex editor solves the issue.
Installing '-r "c:\projects\temp\WorkerProject3\WorkerProject3\worker.py"'
Exception:
Traceback (most recent call last):
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pip\basecommand.py", line 134, in main
    status = self.run(options, args)
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pip\commands\install.py", line 220, in run
    for req in parse_requirements(filename, finder=finder, options=options):
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pip\req.py", line 1477, in parse_requirements
    req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pip\req.py", line 129, in from_line
    return cls(req, comes_from, url=url, prereleases=prereleases)
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pip\req.py", line 44, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pkg_resources.py", line 2914, in parse
    reqs = list(parse_requirements(s))
  File "c:\projects\temp\WorkerProject3\WorkerProject3\env\lib\site-packages\pkg_resources.py", line 2827, in parse_requirements
    raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '\xef\xbb\xbffrom azure.servicebus import ServiceBusService')
Storing complete log in C:\Users\huvalo\pip\pip.log
'-r "c:\projects\temp\WorkerProject3\WorkerProject3\worker.py"' failed to install. Exit code: 2

comments

Zooba wrote May 19 at 11:22 PM

It works fine with pip 1.5.4 (which is now the one we install), but go ahead and remove the BOM.

huguesv wrote May 20 at 9:44 PM

It didn't work for me with pip 1.5.4, so I've deleted the BOM.