I want to get a list of installed PIP packages with the URLs to those packages.
I know that there is pip list
command that lists all the packages installed, but it doesn't show the URL to package home page.
There is also pip show
command that shows info about a package including its URL, but it only works for one package.
Is there a way to combine both commands to get a full list of packages with their respective home page URLs?
To do so, we can use the pip list -o or pip list --outdated command, which returns a list of packages with the version currently installed and the latest available. On the other hand, to list out all the packages that are up to date, we can use the pip list -u or pip list --uptodate command.
Searching for packages pip searches http://pypi.python.org/pypi by default but alternative indexes can be searched by using the --index flag.
pip looks for packages in a number of places: on PyPI (if not disabled via --no-index ), in the local filesystem, and in any additional repositories specified via --find-links or --index-url .
Start the Anaconda Navigator application. Select Environments in the left column. A dropdown box at the center-top of the GUI should list installed packages. If not, then select Installed in the dropdown menu to list all packages.
One way to do it is with this shell one-liner:
pip list --format=freeze | cut -d= -f1 | xargs pip show | awk '/^Name/{printf $2} /^Home-page/{print ": "$2}'
Where we simply reformatted the output of the pip show
command being executed via xargs
for all packages returned by pip list
.
Sample output:
appdirs: http://github.com/ActiveState/appdirs
packaging: https://github.com/pypa/packaging
pip: https://pip.pypa.io/
setuptools: https://github.com/pypa/setuptools
six: http://pypi.python.org/pypi/six/
wheel: https://bitbucket.org/pypa/wheel/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With