Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Absolute vs Relative Imports in Python: Summary

Give Feedback

Congratulations! You’re now up to speed on how absolute and relative imports work in Python. You’ve learned the best practices for writing import statements, and you know the difference between absolute and relative imports.

With your new skills, you can confidently import packages and modules from the Python standard library, third party packages, and your own local packages. Remember that you should generally opt for absolute imports over relative ones, unless the path is complex and would make the statement too long.

aradim on Sept. 11, 2019

Thanks , very helpfull

Chasp on Sept. 11, 2019

Succinct and understandable… good job!

abakala on Nov. 19, 2019

Thanks, it was very helpful!

Sachin on Dec. 17, 2019

Nice, clear and simple explanation!! This is first time I have understood this!!

Priya katta on Dec. 20, 2019

very helpful…thanks!

Pakorn on Jan. 1, 2020

Good job. Thanks

Crystal Taggart on May 18, 2020

I’d recommend adding a video for this command for relative imports:

import sys sys.path.append(“..”)

Alan ODannel on July 15, 2020

Very helpful. I put this to immediate use cleaning up a Python application that I inherited at wok.

Become a Member to join the conversation.