Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 611
Lowan Avatar asked May 13 '20 02:05

Lowan


People also ask

How do I find pip package version?

To check which version of a given package is installed, use the pip show <your_package> command. For example, to check the version of your NumPy installation or virtual environment, run pip show numpy in your command line or Powershell (Windows), or terminal (macOS and Linux/Ubuntu).

Does pip freeze show dependencies?

pip freeze might seem very useful initially but it can mess up your project because of the following reasons: It dumps all the libraries installed in your project including dependencies and sub-dependencies in the requirements. txt file. It still misses out on the libraries that are not installed using pip.

How do I specify package version in pip install?

To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .


1 Answers

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

like image 145
X Æ A-Xiii Avatar answered Sep 21 '22 15:09

X Æ A-Xiii