Created
July 14, 2023 11:29
-
-
Save gsoykan/bebf700b52a001938d088e03c7c83200 to your computer and use it in GitHub Desktop.
checks a python package source -> really useful when package errors happen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import inspect | |
| import ssl # Replace with the name of the imported package you want to check | |
| def get_package_source(package): | |
| module = inspect.getmodule(package) | |
| if module is not None: | |
| source_file = inspect.getfile(module) | |
| print(f"Source location for package '{package.__name__}': {source_file}") | |
| else: | |
| print(f"Package '{package.__name__}' is not found.") | |
| get_package_source(ssl) # Replace with the imported package you want to check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment