简体   繁体   English

如何查看 virtualenv 中 package 版本的历史记录?

[英]How to check the history of package versions in virtualenv?

I want to know what was the previous version of package that was installed in my vitrualenv before I have upgraded it.我想知道在升级之前安装在我的 vitrualenv 中的 package 的先前版本是什么。 Lets say I have lib==1.1.0 then I upgrade it using pip install upgrade lib==1.2.0 and after that I want to check what was the previous version ( 1.1.0 )假设我有lib==1.1.0然后我使用pip install upgrade lib==1.2.0升级它然后我想检查以前的版本是什么( 1.1.0

what was the previous version of package that was installed in my vitrualenv我的 vitrualenv 中安装的 package 的先前版本是什么

Unfortunaltey, a virtualenv does not keep track of changes made to it.不幸的是,virtualenv 不会跟踪对其所做的更改。

As @Grismar pointed out, you may "freeze" the list of all installed packages, and then re-install to the previous set at a later point:正如@Grismar 指出的那样,您可以“冻结”所有已安装软件包的列表,然后稍后重新安装到以前的集合:

$ pip freeze > requirements.txt   
$ pip install -r requirements.txt 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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