Thursday, October 6, 2022

[SOLVED] pip freeze doesn't show package version

Issue

Over the weekends I have upgraded my Ubuntu to 20.04, and I tried creating virtualenvironment with python 3.8.2, and pip install requirements.txt. In requirement.txt, I am installing some code from private gitlab repositories.

Previously, if I do pip freeze, I was able to see all packages name and version (formatted as package_name == version.

However, if I do pip freeze, now I see something like this...

pkg1 @ file:///tmp/tmp44ir_jik
pkg2 @ file:///tmp/tmp5pijtzbq
...

(pkg1 and pkg2 are both from pip installing private git repo)

I would like to somehow display the version, but don't know how to.

I mean, pip list does show the version, but I am writing a script and would like to use pip freeze for it. How can I get pip freeze to show how it use to before (with the format as pkg_name==pkg_version)?

Thanks in advance.


Solution

You can use pip list --format=freeze instead.



Answered By - X Æ A-Xiii
Answer Checked By - Katrina (WPSolving Volunteer)