388

I'd like to add comments for a few packages in a pip requirements file. (Just to explain why that package is on the list.) Can I do this?

I'm imagining something like

Babel==0.9.5 # translation
CherryPy==3.2.0 # web server
Creoleparser==0.7.1 # wiki formatting
Genshi==0.5.1 # templating
lofidevops
  • 15,528
  • 14
  • 79
  • 119

1 Answers1

528

Sure, you can, just use #

pip docs:

A line that begins with # is treated as a comment and ignored. Whitespace followed by a # causes the # and the remainder of the line to be treated as a comment.

CreepyRaccoon
  • 826
  • 1
  • 9
  • 19
Alexander Artemenko
  • 21,378
  • 8
  • 39
  • 36
  • 14
    To anyone visiting from google: note the important word **whitespace** here. If you don't have whitespace, e.g. "beautifulsoup4#==4.8.2", the characters after the # will not be treated as a comment. – jtb Mar 01 '23 at 19:20