[ERROR FIXED] “Attempted relative import in non-package” even with __init__.py

preview_player
Показать описание

►► Do you want to thrive as a self-employed Python freelancer controlling your own time, income, and work schedule?

⁉️ Do you have a question? Leave a comment and we will answer as soon as possible!

⏰ Subscribe to the channel, never miss a new video!

🐍 Did you know? Finxter is one of the top 10 Python Blogs on the internet!

🚀 More about Python & Freelancing:

#finxter #python

Do you want to thrive as a self-employed Python freelancer controlling your own time, income, and work schedule? Check out our Python freelancer resources:

Finxter Python Freelancer Course:

Finxter Python Freelancer Webinar:

Leaving the Rat Race with Python (Book):
Рекомендации по теме
Комментарии
Автор

This didn't work. I did from project.utility import pytool and it gave me an error saying the project module doesn't exist, but that's the main folder where the utility folder lives... so I don't understand what's going on.

FrocketGaming
Автор

I went through so many blogs on "Relative Imports", not even one blog or article or video gave a clear explanation on the errors raised. Your video is Awesome!! Thank you!

sukanya
Автор

This was helpful. Thank the second way worked for me

felixkuria
Автор

Perfect Explanation. Cleared my all doubts.

RISHABH
Автор

on mac still didn't help (except for adding sys)

magneat
Автор

this did not help me. now i get " no module named tests"

miladgolkaram
Автор

this sys.append is sad
but it works
tnks

felipe_marra