PCAP • Practice Test 20
Free PCAP practice test — 15 questions with explanations. Set 20. No signup required.
A Python project has the following directory structure:
project/ __init__.py main.py subpackage/ __init__.py module.py
Inside 'module.py', there is a function 'func' that needs to be imported in 'main.py'. The team wants to import 'func' using a relative import from 'main.py'. However, when they run 'python main.py' from the project root, they get an ImportError. What is the most likely reason?