我正在使用pip3 list --outdated --format=freeze
进行当前安装的所有软件包的批量更新。
最近,我注意到一个包rst2pdf
是要保留在pip3 install -U
之后的。
我在MacOS High Sierra和Ubuntu 16.04上遇到此问题。
从python编程的角度来看,没关系,因为我可以使用它。
但是从系统管理员的角度来看,所有时间包都在下载,并且浪费时间和带宽。
有什么方法可以从pip3 list --outdated
输出中删除成品?
这是命令输出:
bash-3.2$ pip3 install -U rst2pdf
Collecting rst2pdf
Requirement already up-to-date: reportlab>=2.4 in /usr/local/lib/python3.6/site-packages (from rst2pdf)
Requirement already up-to-date: pdfrw in /usr/local/lib/python3.6/site-packages (from rst2pdf)
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages (from rst2pdf)
Requirement already up-to-date: Pygments in /usr/local/lib/python3.6/site-packages (from rst2pdf)
Requirement already up-to-date: docutils in /usr/local/lib/python3.6/site-packages (from rst2pdf)
Requirement already up-to-date: pillow>=2.4.0 in /usr/local/lib/python3.6/site-packages (from reportlab>=2.4->rst2pdf)
Requirement already up-to-date: pip>=1.4.1 in /usr/local/lib/python3.6/site-packages (from reportlab>=2.4->rst2pdf)
Installing collected packages: rst2pdf
Found existing installation: rst2pdf 0.93.dev0
Uninstalling rst2pdf-0.93.dev0:
Successfully uninstalled rst2pdf-0.93.dev0
Successfully installed rst2pdf-0.93.dev0
bash-3.2$ echo $?
0
bash-3.2$ pip3 list --outdated
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
rst2pdf (0.93.dev0) - Latest: 0.93 [sdist]
更新时间:2018/02/22
当我卸载rst2pdf并重新安装它时,我得到相同的结果。
这是bash日志:
$ sudo pip3 uninstall rst2pdf
Uninstalling rst2pdf-0.93.dev0:
/usr/local/bin/rst2pdf
/usr/local/lib/python3.5/dist-packages/rst2pdf-0.93.dev0-py3.5.egg-info
......(snip)....
/usr/local/lib/python3.5/dist-packages/rst2pdf/writer.py
Proceed (y/n)? y
Successfully uninstalled rst2pdf-0.93.dev0
$
$ sudo pip3 install rst2pdf
Downloading rst2pdf-0.93.tar.gz (1.3MB)
100% |████████████████████████████████| 1.3MB 706kB/s
Requirement already satisfied: setuptools in /usr/local/lib/python3.5/dist-packages (from rst2pdf)
Requirement already satisfied: docutils in /usr/local/lib/python3.5/dist-packages (from rst2pdf)
Requirement already satisfied: reportlab>=2.4 in /usr/local/lib/python3.5/dist-packages (from rst2pdf)
Requirement already satisfied: Pygments in /usr/local/lib/python3.5/dist-packages (from rst2pdf)
Requirement already satisfied: pdfrw in /usr/local/lib/python3.5/dist-packages (from rst2pdf)
Requirement already satisfied: pip>=1.4.1 in /usr/local/lib/python3.5/dist-packages (from reportlab>=2.4->rst2pdf)
Requirement already satisfied: pillow>=2.4.0 in /usr/local/lib/python3.5/dist-packages (from reportlab>=2.4->rst2pdf)
Installing collected packages: rst2pdf
Running setup.py install for rst2pdf ... done
Successfully installed rst2pdf-0.93.dev0
$
$ pip3 list --outdated
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
rst2pdf (0.93.dev0) - Latest: 0.93 [sdist]
$
最佳答案
https://pypi.python.org/pypi/rst2pdf上没有可下载的软件包-无需更新。您可以尝试从https://github.com/rst2pdf/rst2pdf升级
pip install --upgrade git+https://github.com/rst2pdf/rst2pdf.git#egg=rst2pdf