Python 使用 easy_install 安装特定版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3833011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 12:56:26  来源:igfitidea点击:

Install particular version with easy_install

pythonversioneasy-install

提问by dr jerry

I'm trying to install lxml. I've had a look at the website, and version 2.2.8 looked reasonable to me but when I did easy_install lxml, it installed version 2.3.beta1 which is not really what I want I presume.

我正在尝试安装lxml. 我看过网站,2.2.8 版对我来说看起来很合理,但是当我这样做时easy_install lxml,它安装了 2.3.beta1 版,这并不是我想要的,我认为。

What is the best way to fix this and how can I force easy_install to install a particular version?

解决此问题的最佳方法是什么,如何强制 easy_install 安装特定版本?

(Mac os x 10.6)

(Mac 操作系统 x 10.6)

采纳答案by Ben James

I believe the way to specify a version would be like this:

我相信指定版本的方法是这样的:

easy_install lxml==2.2.8

I (and most other Python users I suspect) stopped using easy_installand started using pipsome time ago, so a solution in those terms is:

我(以及我怀疑的大多数其他 Python 用户)停止使用easy_install并在pip一段时间前开始使用,因此在这些方面的解决方案是:

easy_install pip
pip install lxml==2.2.8

(piphas several benefits, including an uninstallcommand)

pip有几个好处,包括一个uninstall命令)

回答by CuriousCurmudgeon

From the easy_install documentation:

从 easy_install文档

easy_install PackageName==1.2.3

easy_install PackageName==1.2.3

回答by pyfunc

You should do something like this:

你应该做这样的事情:

easy_install "lxml==2.2.8"