Timeline for How can I list all packages/modules available to Python from within a Python script?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 23, 2021 at 2:14 | comment | added | user3064538 |
If you look where help('modules') is implemented, github.com/python/cpython/blob/… you can just copy/paste that code and get the output in a list, parsing the stdout of a function call is hacky.
|
|
| May 19, 2020 at 14:23 | comment | added | spectras | Yes, the pkgutil version will only return modules that are present as files. So the modules that come builtin, compiled right into python won't be included. This is usually not a problem as such scripts are typically used for dependency scanning, and you don't care about builtins in such case — grats on hitting 10k btw ;). | |
| Jan 19, 2020 at 10:43 | history | edited | sancho.s ReinstateMonicaCellio | CC BY-SA 4.0 |
added 303 characters in body
|
| Jan 8, 2020 at 9:33 | history | answered | sancho.s ReinstateMonicaCellio | CC BY-SA 4.0 |