Can you tell us more about your use case or larger goals? Getting an answer to non-importable modules is an interesting problem, and I don’t have an answer to how you formulated it, but depending on your actual use, you may be interested in determining if IDEs (integrated development environments) can do what you ask.
For example, if you install PyCharm (available free of charge in the community edition), you can enter the full or partial name of the function (just a text string), and then search in the active IDE project to see what you are looking for. For example, you can simply type “walk” on a line and then (IIR) click on it to see which possible modules can have the corresponding functions. You can also search in a different direction, seeing where the function is used in the project.
To search on a large scale, you may have to cheat a little and open your Python directory as a “project”, but it’s easy.
Again, you did not present a precedent, so apologize if you are specifically looking for, for example, a way to get this result for later use in the program. If you want you to be responsible for you as a developer and how you work, you can look at the tools you use to give an answer.
source share