Virtualenv / pip installation log?

2019-06-17 11:13发布

问题:

Do pip or virtualenv keep a log of installations?

E.g. Say I create a virtualenv and install a package in it.

> source [my virtual env]/bin/activate
> pip install matplotlib

Is there a place where a log of the package installation is kept?

If not, what would be a good way to log package installations ? (other than manually copying the output of pip install to a text file)

回答1:

When you run the pip, you can specify the logfile.

pip install matplotlib --log LOG_FILE

That file will contain the verbose log

for example,

pip install matplotlib --log log.txt

This will create a log.txt in the same directory and put the log in that.



回答2:

If you care about keeping the logs, you probably care also about pip's verbose option