Question 7: What if the module is in a different directory than my notebook?

Question

Grade: Education Subject: Support
Question 7: What if the module is in a different directory than my notebook?
Asked by:
77 Viewed 77 Answers

Answer (77)

Best Answer
(244)
If the module is in a different directory, you need to specify the full path to the module when importing it. For example, `from my_package.my_module import my_function`. You can find the module's location using `import sys; print(sys.path)`.