Listing imported packages

Are there any macros, functions, or any ways to show the list of packages imported by “using”? I cannot find a relevant function/macro at https://docs.julialang.org/en/stable/stdlib/pkg/.

filter(name-> eval(name) isa Module, names(Main)) gets a list of available module names

1 Like

This is helpful, but slightly different from what I want. Suppose I have a module named MyModule, in which ModuleA is imported by using ModuleA. Now, if I do using MyModule in Main, your method shows not only MyModule but also ModuleA, whose symbols are not exported in Main.

Yeah to be honest I don’t know about this one. I’ve been messing around with the code but I can’t find a way to exclude nested modules. what exactly is your use case?

I just wanted to check if the module meant to be imported by some script was imported correctly. After running the script, I wanted to check if the module was indeed imported.