0

I created a folder named collections, inside I defined some collections-related modules. When I went to used them, I got an ModuleNotFoundError.

Changing the name of collections to my_collections worked.

The weird thing is that my module was called binary_search_tree, which is not present in Python's collections module. Is the interpreter just paying attention to the first part of the full module name and ignoring the rest? This means, even if the full module is not one defined my Python's library, it will look at the collections module from Python.

I thought the search was being done considering the full module's name, am I missing something?

2

0

Your Answer

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.