Python - Importing your modules (Part 2: Import from a different folder ~7 mins! no ads)

preview_player
Показать описание
Hey guys, In this episode I’m going to demonstrate how to import your own python packages within various folders relative to your main python file. Feel free to pause as I go along in this python tutorial. This is a very quick but very useful technique that every python developer should know. I’ll post the python files to my GitHub soon so you can grab it from there if you want a starting point.

My Github account:

This is a quick 5 minute video that’ll show you how to import your own modules and call methods from that module from other python files in that solution.

Please follow along, pause the video if you need to. Feel free to checkout the rest of my Python playlist as well :) I will be doing other themed playlists like JavaScript, Flutter, Swift and programming concepts such as data structures, Design Patterns etc.

We will try to keep the content fun and engaging through tutorials and projects where you can find some quick wins and get motivated to move on to the next video.

Let’s go on this journey together and become awesome developers/analysts! Happy coding!

SUBSCRIBE:
Please do subscribe to the channel here:

NOTIFICATIONS:
Remember to hit the bell notification icon and select all for updates on any of my future content!

Music:
Xaia, Rain Man, Oly - Breakdown [NCS Release]

Download VSC:

Download PyCharm:

Equipment:
Blue Yeti Mic:

TAGS:
PyCharm, Conda, Environments, Env, Conda env, Visual Studio Code, VSC, VS Code, IDE, Github, Git, clone, JavaScript, TheDevLife, Python, developer, big data, analytics, analyst, coding, programming, analysis, developer, coder, scripting, download, install, intro, python 101, intro to python, import, importing modules
Рекомендации по теме
Комментарии
Автор

I've read millions of solutions. They explained so much that a book was written. Thank you for solving it so quickly. I wish I had come across your video first.

emremicrosoft
Автор

I searched the entire website. You are the one I who explains the issue simply. Thanks.

onurkaraguler
Автор

music is very distracting, reconsider it..

shallow_choices
Автор

Perfect! Just What I was looking for! No Ads!!!

sanedeen
Автор

Everytime I found this error, I moved files and directories in my project to deal with. This video is a changing video for me and my future projects. Simply, thanks!

fabriziosulca
Автор

You have saved mylife! I can now run tests from a different directory and import modules from a another directory. Thanks

erastowamuti
Автор

Thanks man you helped me a lot, keep up with the good work you are doing

kiragu
Автор

Thank you so much <3. I was searching for this since yesterday, and from your video, I got the answer.

yasir
Автор

To the point and very helpful! Thanks!!

divakark
Автор

thanks a lot, this is the best video teaching how to navigate modules so far.

quangpham
Автор

THAT ALL WE NEEDED!!!!...Thank you so much

SpanishJohn
Автор

Thank you so much, other tutorial cannot understand at all, i guess i need more time (Just started learning python this yr)

fiona
Автор

This is actually helpful. But the background music is so distraction.

zacky
Автор

Thank you for teaching me this secret magic spell, that can never be found elsewhere on the internet.

bailumusic
Автор

thank you, video is so easy to understand.

BepDieuThao
Автор

Thank you so much ! It works perfectly :)

princesatartaruga
Автор

after so many hours i am getting it right. you have saved so many times. play it with .75 speed.

Rudra-gous
Автор

Thanks good explenation! is there anyway to avoid the sys.path hack if you want to import from parrent directory?

IgnitedMountain
Автор

Hey, Have question. If we want to import function from helper2.py to helper1.py, what to do? (in my case, I want to use data_processing.py file from processing folder TO data_visualizaition.py in visualization folder. (!!!)

vd.se.
Автор

Hey, big thanks for this! But I have a question. What happens when the main.py file is itself inside another folder say "src/main.py"? The second method is not working. Any quick fix?

anotherrandomguy