Problem
Hi. I'm having issues importing a module I wrote. The module I want to import is called neural_networks, defined in the neural_networks.py file.
Directory tree:
├── neural_networks.py └── directory ├── neural_networks.py └── calling_module.py neural_networks.py
def function_to_import(): pass I read Python 3 docs in the section 5.7. Package Relative Imports, and applyed what's written there, but it's not all working.
calling_module.py
// ImportError: attempted relative import with no known parent package from . import neural_networks // SyntaxError: invalid syntax import ..neural_networks // ImportError: attempted relative import with no known parent package from ..directory import neural_networks // SyntaxError: invalid syntax import .neural_networks // works and i can use function_to_import() using neural_networks.function_to_import() import neural_networks Question
How can I correctly import and use neural_networks module in calling_module?
Thanks in advance.