Python Forum
Problems with importing classes in different folder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with importing classes in different folder
#2
You need to provide __init__.py at top level, and
empty __init__.py in src and sub-folders.
See: https://docs.python.org/3/tutorial/modul...l#packages
The top level __init__.py lets python know where dependencies are located.
Reply


Messages In This Thread
RE: Problems with importing classes in different folder - by Larz60+ - Nov-08-2017, 10:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 591 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,547 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  Move file from one folder to another folder with timestamp added end of file shantanu97 0 2,495 Mar-22-2021, 10:59 AM
Last Post: shantanu97
  Python Cut/Copy paste file from folder to another folder rdDrp 4 5,108 Aug-19-2020, 12:40 PM
Last Post: rdDrp
  Problems with inheritance with classes internetguy 3 2,640 Jul-04-2019, 11:59 AM
Last Post: metulburr
  Encoding problems on multiple files in one folder NikolajKorsgaard 5 4,028 Jun-11-2019, 03:39 AM
Last Post: micseydel
  Including classes from folder issue graham23s 1 1,983 Apr-03-2019, 07:33 AM
Last Post: Gribouillis
  Problems parsing /proc folder anddontyoucomebacknomore 2 2,583 Mar-06-2019, 09:16 PM
Last Post: DeaD_EyE
  Delete directories in folder is not working after folder is updated asheru93 2 2,676 Feb-13-2019, 12:37 PM
Last Post: asheru93
  Importing classes? frequency 11 4,828 Dec-31-2018, 07:21 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020