watermark icon indicating copy to clipboard operation
watermark copied to clipboard

Feature to auto-pull info of all imported packages

Open rasbt opened this issue 8 years ago • 4 comments

I think a new flag, e.g.,

--pull_pkginfo

or so could be useful to list all unique packages used in a notebook and the respective version numbers. Right now, we have

-p      --packages

which is useful to display the version numbers of a list of packages, which can be useful to limit the scope of packages that should be displayed. For example.

%watermark -p numpy,scipy
numpy 1.9.2
scipy 0.15.1

The --pull_pkginfo would preferably be run at the end of an IPython notebook so that a user don't have to worry about specifying packages "manually." It should scan an collect unique imports in the notebook and list all the packages, e.g.,

%watermark --pull_pkginfo
    numpy 1.9.2
    scipy 0.15.1
    ...

Maybe excluding packages from the standard lib since we already have a -v flag to show the Python version number.

rasbt avatar Sep 02 '15 16:09 rasbt

@rasbt You thinks solution might lead the way? https://stackoverflow.com/questions/40428931/package-for-listing-version-of-packages-used-in-a-jupyter-notebook

The idea is to pkg_resources library and pulling the packages + version numbers from that. Let me try next year and see what happens

ljvmiranda921 avatar Dec 26 '18 09:12 ljvmiranda921

Yeah, the use of pkg_resources sounds fine to me. (Also see the related discussion at #41)

rasbt avatar Dec 26 '18 15:12 rasbt

Yes this would be a valuable feature; it certainly beats having to manually specifying each package. Often the user just wants the version of all packages imported in the Jupyter notebook.

cpoptic avatar Feb 21 '19 17:02 cpoptic

Btw I forgot that we have a

%watermark -iv

E.g.,

screen shot 2019-02-21 at 12 00 57 pm

rasbt avatar Feb 21 '19 18:02 rasbt