Improved the package import for different python version.