Python 3 comes with syntax changes for imports within a package by requiring us to use the relative imports syntax. There are libraries with a different package import for each Python version; for example, the URL library urllib.request is for Python 3, and urllib2 is for Python 2. This chapter describes how to ensure compatibility with relative imports and how to import a suitable package based on the Python version.
Before I go in detail about compatibility with package imports, let me take you a step back and go through Python’s importing infrastructure.
Python Imports
Like any other ...