1

I have the following folder structure:

enter image description here

In this process_file.py script I want to be able to import the class process_things.py which is in the classes folder. Tried following method 3 in this blog but it doesn't seem to work: https://blog.finxter.com/python-how-to-import-modules-from-another-folder/

I have noticed that if I put the process_file.py file outside the jobs folder and run from classes import process_file then it works fine, but ideally I really want the file to be in the jobs folder.

asked Aug 23, 2022 at 10:18

1 Answer 1

1

did you check sys lib? a quick way like this :

 import sys
 sys.path.append('/path_to_your_project_folder/src/databricks/classes')
 import process_things
answered Aug 23, 2022 at 10:48
Sign up to request clarification or add additional context in comments.

1 Comment

yeah that works but I want to stick to method 3 if possible

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.