ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.2 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/ |
| Last Crawled | 2026-04-10 15:01:40 (6 days ago) |
| First Indexed | 2019-09-12 06:01:03 (6 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Absolute vs Relative Imports in Python: Summary (Video) – Real Python |
| Meta Description | Now you know the difference between absolute and relative imports. In this video, we’re going to quickly recap on the differences between the two and when you would want to use one method over the other. First, an absolute import specifies a… |
| Meta Canonical | null |
| Boilerpipe Text | 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.
00:00
Now you know
the difference between absolute and relative imports. In this video,
we’re going to quickly recap on the differences between the two and when you
would want to use one method over the other. First, an absolute import specifies
a resource from the point of view of the project root directory,
00:19
while a relative import is based on where the
import
statement is located.
00:25
There are many pros to using absolute imports.
First, they’re based on the project root directory,
so moving files around means you don’t have to change their
import
statements.
00:36
They’re also very readable. Taking a look at an absolute import
clearly identifies the resource location. And finally,
they’re preferred per PEP 8.
The only real con to using an absolute import is they can be very verbose and
repetitive based on your project size, so this is something to keep in mind.
00:55
Overall,
in most cases you want to use absolute imports as much as possible. Relative
imports offer up a couple different advantages. Off the bat,
they’re much more concise than absolute imports.
01:07
This advantage is based on your directory structure,
so if you organize your modules and packages
so that similar resources are located near each other,
you can gain a lot by using relative imports. Drawbacks to using relative imports
include that they’re not as readable as absolute imports and changing your
project can break those imports. Now if you move a file,
you often have to change your imports to point to the same resource. Finally,
like before, this advantage is really dependent on your directory structure.
01:39
If you have files that are often reaching all the way across your directory
for a resource,
you may not get as much of a benefit out of using relative imports.
01:48
Generally, you’ll use relative imports when your project is very large with many
submodules and packages
or you’re using frameworks that are structured in a way that relative imports
usually work. And that’s it!
02:01
You should have a solid understanding of the basics between absolute and
relative imports. This topic can be a bit tricky to understand,
so the best way to learn is to go ahead and practice.
02:12
Try using both methods in your next project and see which one works out better
for you. Thanks for watching. |
| Markdown | [](https://realpython.com/)
- [Start Here](https://realpython.com/start-here/)
- [Learn Python](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/)
[Python Tutorials → In-depth articles and video courses](https://realpython.com/search?kind=article&kind=course&order=newest)
[Learning Paths → Guided study plans for accelerated learning](https://realpython.com/learning-paths/)
[Quizzes & Exercises → Check your learning progress](https://realpython.com/quizzes/)
[Browse Topics → Focus on a specific area or skill level](https://realpython.com/tutorials/all/)
[Community Chat → Learn with other Pythonistas](https://realpython.com/community/)
[Office Hours → Live Q\&A calls with Python experts](https://realpython.com/office-hours/)
[Live Courses → Live, instructor-led Python courses](https://realpython.com/live/)
[Podcast → Hear what’s new in the world of Python](https://realpython.com/podcasts/rpp/)
[Books → Round out your knowledge and learn offline](https://realpython.com/products/books/)
[Reference → Concise definitions for common Python terms](https://realpython.com/ref/)
[Code Mentor →Beta Personalized code assistance & learning tools](https://realpython.com/mentor/)
[Unlock All Content →](https://realpython.com/account/join/)
- [More](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/)
[Learner Stories](https://realpython.com/learner-stories/) [Python Newsletter](https://realpython.com/newsletter/) [Python Job Board](https://www.pythonjobshq.com/) [Meet the Team](https://realpython.com/team/) [Become a Contributor](https://realpython.com/jobs/)
- [Search](https://realpython.com/search "Search")
- [Join](https://realpython.com/account/join/)
- [Sign‑In](https://realpython.com/account/login/?next=%2Flessons%2Fabsolute-vs-relative-imports-python-summary%2F)

**Join us and get access to thousands of tutorials and a community of expert Pythonistas.**
[Unlock This Lesson](https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=absolute-vs-relative-imports-python)

This lesson is for members only. **Join us and get access to thousands of tutorials and a community of expert Pythonistas.**
[Unlock This Lesson](https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=absolute-vs-relative-imports-python)
# Absolute vs Relative Imports in Python: Summary
[](https://realpython.com/courses/absolute-vs-relative-imports-python/#team)
**[Absolute vs Relative Imports in Python](https://realpython.com/courses/absolute-vs-relative-imports-python/)**
[Joe Tatusko](https://realpython.com/courses/absolute-vs-relative-imports-python/#team)
02:20
Mark as Completed
Supporting Material
[Recommended Tutorial](https://realpython.com/absolute-vs-relative-python-imports/)
[Ask a Question](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#discussion)
- [Contents](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#description)
- [Transcript](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#transcript)
- [Discussion (11)](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#discussion)
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.
**Congratulations, you made it to the end of the course\!** What’s your \#1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the *discussion* section and let us know.
[**00:00**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=0.6) [Now you know](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=0.6) [the difference between absolute and relative imports. In this video,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=1.23) [we’re going to quickly recap on the differences between the two and when you](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=5.49) [would want to use one method over the other. First, an absolute import specifies](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=9.03) [a resource from the point of view of the project root directory,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=15.03)
[**00:19**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=19.71) [while a relative import is based on where the `import` statement is located.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=19.71)
[**00:25**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=25.11) [There are many pros to using absolute imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=25.11) [First, they’re based on the project root directory,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=28.1) [so moving files around means you don’t have to change their `import` statements.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=31.19)
[**00:36**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=36.08) [They’re also very readable. Taking a look at an absolute import](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=36.08) [clearly identifies the resource location. And finally,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=39.53) [they’re preferred per PEP 8.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=43.7) [The only real con to using an absolute import is they can be very verbose and](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=46.13) [repetitive based on your project size, so this is something to keep in mind.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=50.09)
[**00:55**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.04) [Overall,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.04) [in most cases you want to use absolute imports as much as possible. Relative](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.73) [imports offer up a couple different advantages. Off the bat,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=60.83) [they’re much more concise than absolute imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=64.7)
[**01:07**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=67.94) [This advantage is based on your directory structure,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=67.94) [so if you organize your modules and packages](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=70.67) [so that similar resources are located near each other,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=73.16) [you can gain a lot by using relative imports. Drawbacks to using relative imports](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=76.58) [include that they’re not as readable as absolute imports and changing your](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=82.07) [project can break those imports. Now if you move a file,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=86.3) [you often have to change your imports to point to the same resource. Finally,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=90.2) [like before, this advantage is really dependent on your directory structure.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=95.27)
[**01:39**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=99.44) [If you have files that are often reaching all the way across your directory](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=99.44) [for a resource,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=103.19) [you may not get as much of a benefit out of using relative imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=104.45)
[**01:48**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=108.5) [Generally, you’ll use relative imports when your project is very large with many](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=108.5) [submodules and packages](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=112.58) [or you’re using frameworks that are structured in a way that relative imports](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=114.56) [usually work. And that’s it\!](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=118.37)
[**02:01**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=121.1) [You should have a solid understanding of the basics between absolute and](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=121.1) [relative imports. This topic can be a bit tricky to understand,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=124.61) [so the best way to learn is to go ahead and practice.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=128.81)
[**02:12**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=132.41) [Try using both methods in your next project and see which one works out better](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=132.41) [for you. Thanks for watching.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=136.13)

**aradim** on [Sept. 11, 2019](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-e411ff3f-0c23-46b7-b07a-c8d949dcfe2a)
Thanks , very helpfull

**Chasp** on [Sept. 11, 2019](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-af9d430f-180a-4124-8d95-e0c4a749f0b3)
Succinct and understandable… good job\!

**abakala** on [Nov. 19, 2019](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-fd0047c7-40df-452c-bfaf-85db6f758b1e)
Thanks, it was very helpful\!

**Sachin** on [Dec. 17, 2019](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-e25cab8d-19d9-4256-bc06-4d17c5b89660)
Nice, clear and simple explanation!! This is first time I have understood this!\!

**Priya katta** on [Dec. 20, 2019](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-967ad3b3-3a46-40ce-a84d-575ed6c118be)
very helpful…thanks\!

**Pakorn** on [Jan. 1, 2020](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-4badefec-3065-4923-acf5-db9073a00951)
Good job. Thanks

**Crystal Taggart** on [May 18, 2020](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-6ed92f7f-e912-4eef-9e92-a33d4779e9a8)
I’d recommend adding a video for this command for relative imports:
import sys sys.path.append(“..”)

**Alan ODannel** on [July 15, 2020](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-d8a5ee7c-be24-4f59-beff-aeeaeb442976)
Very helpful. I put this to immediate use cleaning up a Python application that I inherited at wok.

**Sid Price** on [Oct. 12, 2020](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-a06a0208-f6d7-4603-82a2-c35e34b369a2)
Really enjoyed the import course\!
I have a project folder structure and import situation I do not seem to be able to resolve, so, hoping you can help me.
I have:
```
```
In the app folder I am developing a dialog widget and I would like to test it standalone. It has code in it that when the module is the “main” module it creates an application object and instantiates the dialog for testing.
The issue I face is that the dialog widget requires access to modules in the “App Folder” and I cannot figure out how to do that.
You advice would be much appreciated. Sid

**Ghani** on [Oct. 26, 2020](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-3635426c-bbe4-4b17-8919-729a05cc5ada)
Very good course; thanks\!

**Aldir** on [Dec. 21, 2021](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#comment-f71b90f6-8311-4f3d-a766-56495cd18ac9)
Well done Joe. Short and to the point!! Thank you
[Become a Member](https://realpython.com/account/join/) to join the conversation.
Course Contents
[Overview](https://realpython.com/courses/absolute-vs-relative-imports-python/)
100%
© 2012–2026 Real Python ⋅ [Privacy Policy](https://realpython.com/privacy-policy/)
 |
| Readable Markdown | 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.
[**00:00**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=0.6) [Now you know](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=0.6) [the difference between absolute and relative imports. In this video,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=1.23) [we’re going to quickly recap on the differences between the two and when you](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=5.49) [would want to use one method over the other. First, an absolute import specifies](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=9.03) [a resource from the point of view of the project root directory,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=15.03)
[**00:19**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=19.71) [while a relative import is based on where the `import` statement is located.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=19.71)
[**00:25**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=25.11) [There are many pros to using absolute imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=25.11) [First, they’re based on the project root directory,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=28.1) [so moving files around means you don’t have to change their `import` statements.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=31.19)
[**00:36**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=36.08) [They’re also very readable. Taking a look at an absolute import](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=36.08) [clearly identifies the resource location. And finally,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=39.53) [they’re preferred per PEP 8.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=43.7) [The only real con to using an absolute import is they can be very verbose and](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=46.13) [repetitive based on your project size, so this is something to keep in mind.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=50.09)
[**00:55**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.04) [Overall,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.04) [in most cases you want to use absolute imports as much as possible. Relative](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=55.73) [imports offer up a couple different advantages. Off the bat,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=60.83) [they’re much more concise than absolute imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=64.7)
[**01:07**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=67.94) [This advantage is based on your directory structure,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=67.94) [so if you organize your modules and packages](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=70.67) [so that similar resources are located near each other,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=73.16) [you can gain a lot by using relative imports. Drawbacks to using relative imports](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=76.58) [include that they’re not as readable as absolute imports and changing your](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=82.07) [project can break those imports. Now if you move a file,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=86.3) [you often have to change your imports to point to the same resource. Finally,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=90.2) [like before, this advantage is really dependent on your directory structure.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=95.27)
[**01:39**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=99.44) [If you have files that are often reaching all the way across your directory](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=99.44) [for a resource,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=103.19) [you may not get as much of a benefit out of using relative imports.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=104.45)
[**01:48**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=108.5) [Generally, you’ll use relative imports when your project is very large with many](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=108.5) [submodules and packages](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=112.58) [or you’re using frameworks that are structured in a way that relative imports](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=114.56) [usually work. And that’s it\!](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=118.37)
[**02:01**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=121.1) [You should have a solid understanding of the basics between absolute and](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=121.1) [relative imports. This topic can be a bit tricky to understand,](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=124.61) [so the best way to learn is to go ahead and practice.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=128.81)
[**02:12**](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=132.41) [Try using both methods in your next project and see which one works out better](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=132.41) [for you. Thanks for watching.](https://realpython.com/lessons/absolute-vs-relative-imports-python-summary/#t=136.13) |
| Shard | 71 (laksa) |
| Root Hash | 13351397557425671 |
| Unparsed URL | com,realpython!/lessons/absolute-vs-relative-imports-python-summary/ s443 |