简体   繁体   中英

pip freeze doesn't show package version

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.

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

I could not comment to answer the question by Iowan above; thus is redundant to the answer by X Æ A-13 :

 pip list --format=freeze > requirements.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM