Reproduction steps:
0) MacOS Sierra
1) brew install python
2) python -c 'import sqlite3'
ImportError: No module named _sqlite3
The SQLite is listed as a recommended dependency and is installed. There is no --with-sqlite and --without-sqlite is not used.
Running brew reinstall python did not help. Used to work out of the box on El Capitan.
Please install CLT
sudo xcode-select --install
and try again.
Thank you, I did indeed still have the command line tools from El Capitan.
User error.
Should brew doctor catch this?
I think this problem is specific to python and a few other formulae (see the pour_bottle block in python.rb) so IMO it may not be the best idea to warn about this in general.
We will consider how to better deal with this problem. Meanwhile, glad the problem is fixed.
Most helpful comment
https://github.com/Homebrew/homebrew-core/issues/5347