https://github.com/probml/superimport
Simple package to lookup missing packages and autoinstall them.
https://github.com/probml/superimport
Last synced: about 1 year ago
JSON representation
Simple package to lookup missing packages and autoinstall them.
- Host: GitHub
- URL: https://github.com/probml/superimport
- Owner: probml
- License: mit
- Created: 2021-05-26T15:54:25.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-12T13:36:10.000Z (almost 5 years ago)
- Last Synced: 2025-03-22T18:42:15.643Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 95.7 KB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# superimport
Simple package to lookup missing packages and autoinstall them.
## Installing using PyPi:
`pip install superimport`
## Usage:
There are two ways to use superimport:
- superimport can be called as a program, see `-h` for args. This allows you to do "superimports" across mulitple files and folders.
- by adding `import superimport` to the top of your python script. This is the per script mode.
## Examples:
See this notebook
## 🔪 Sharp edges 🔪:
- If the missing python package contains a requirement that is not listed in its own requirements.txt and is being used your file will fail anyway.
- If you import superimport twice in the same process (a common usecase is ipython kernels), the second time will not work because of the way python [loads modules](https://docs.python.org/3/reference/import.html) , you would need a something like [deimport](https://github.com/probml/deimport) to deimport the package before being able to import superimport to the desired effect again.
- If you run superimport in ipython, please use [deimport](https://github.com/probml/deimport/) to deimport superimport and use `%run -n` if you use `%run`