我是 python 的新手。我想安装最新版本的 mitmproxy(0.17.1)。系统上安装的当前版本是 0.15。当我做的时候
easy_install -U mitmproxy
它说:
Reading https://pypi.python.org/simple/mitmproxy/
Best match: mitmproxy 0.15
Processing mitmproxy-0.15-py2.7.egg
mitmproxy 0.15 is already the active version in easy-install.pth
所以它找不到最新版本,当我这样做时:
easy_install 'mitmproxy==0.17.1'
我明白了:
No local packages or download links found for mitmproxy==0.17.1
为什么找不到最新版本?我应该怎么做才能安装最新的?
最佳答案
来自 Why use pip over easy_install? (大胆的矿山):
Binary packages are now distributed as wheels (.whl files)—not just on PyPI, but in third-party repositories like Christoph Gohlke's Extension Packages for Windows.
pip
can handle wheels;easy_install
cannot.
如果您访问 mitmproxy在 PyPi 上的页面,您会注意到 0.17
版本的唯一下载是 .whl
格式。
这就是 easy_install
对您不起作用的原因:它找不到它实际上可以为最新版本安装的任何东西。
解决方案
如果由于某种原因您无法使用
pip
,请按照此处的说明操作:Wheel file installation- 基本上,从 TAR 存档安装
wheel
here . - 手动下载您要安装的
.whl
文件。 从命令行运行。
python -m wheel install mitmproxy-0.17-py2-none-any.whl
- 基本上,从 TAR 存档安装
关于python - 通过 easy_install 更新包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38298308/