2

I'm porting my project to support Python 3, it's got a dependency on SQLite, so I've got pysqlite in my requirements.txt

But the pysqlite module doesn't exist in Python 3 (it's built-in), how do I get my requirements.txt to work in both Python 2 and Python 3?

John Carter
  • 53,924
  • 26
  • 111
  • 144

1 Answers1

6

Pip (as of pip 6) supports environment markers.

To require pysqlite only on python < 3, use:

pysqlite ; python_version < '3'

https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers

John Carter
  • 53,924
  • 26
  • 111
  • 144