reynoldsnlp / pipster

pipster: The pythonic way to `pip install`.
MIT License
8 stars 2 forks source link

Make `install_all_deps` function to automatically detect and install dependencies #12

Closed reynoldsnlp closed 1 year ago

reynoldsnlp commented 1 year ago

Since installing dependencies during execution is now possible, it would be nice to have a function that will automatically detect dependencies and install them. For example, in the following code, this function would automatically detect numpy and bs4 and install them.

from pip import install_all_deps
install_all_deps()

import numpy as np
from bs4 import BeautifulSoup  # pip install beautifulsoup4
...

Note that when the distribution name does not match the package name, it must be specified in a comment beginning with pip install