1

Anyone knows how to import an entire script from another folder without using os ? specifically I want to import the script utils_database.py in basic_etl.py I tried to use from utils import utils_database in basic_etl.py but it does not work.

Thanks!

Aceconhielo
  • 3,316
  • 4
  • 19
  • 26

1 Answers1

2

The root folder of your project is one level up from the utils folder, so you have to include 01.etl as the top-level package, but then 01.etl is not a valid package name as it starts with a number, so you should rename the folder to something like etl first and then do from etl.utils import utils_database in base_etl.py.

blhsing
  • 91,368
  • 6
  • 71
  • 106