How to fix an AssertionError when trying to list Python packages with the ‘pip list’ command

The Problem Getting the following assertion error when trying to list the Python packages: pip list … Exception: Traceback (most recent call last): File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 134, in main status = self.run(options, args) File “/usr/lib/python2.7/dist-packages/pip/commands/list.py”, line 80, in run self.run_listing(options) File “/usr/lib/python2.7/dist-packages/pip/commands/list.py”, line 127, in run_listing self.output_package_listing(installed_packages) File “/usr/lib/python2.7/dist-packages/pip/commands/list.py”, line 136, in output_package_listing if dist_is_editable(dist): …