首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用easy_install升级Python

用easy_install升级Python
EN

Stack Overflow用户
提问于 2017-12-07 08:38:10
回答 1查看 1K关注 0票数 0

我使用PortablePython2.7.6.1,并安装了Sphinx1.5.1以创建我的手册。由于狮身人面像在过去几个月里已经取得了很大的进步,我试图升级到最新版本的Sphinx1.6.5,但是我无法使用easy_install工具进行升级。

我试过:

代码语言:javascript
复制
easy_install-2.7.exe -U sphinx

上面写着:

代码语言:javascript
复制
Searching for sphinx
Reading http://pypi.python.org/simple/sphinx/
Couldn't retrieve index page for 'sphinx'
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Best match: sphinx 1.5.1
Processing sphinx-1.5.1-py2.7.egg
sphinx 1.5.1 is already the active version in easy-install.pth

在那之后,我试图强制版本,但这也失败了:

代码语言:javascript
复制
easy_install-2.7.exe -m 1.6.5 sphinx

这是这么说的:

代码语言:javascript
复制
Searching for 1.6.5
Reading http://pypi.python.org/simple/1.6.5/
Couldn't find index page for '1.6.5' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for 1.6.5
Best match: None
Traceback (most recent call last):
  File "C:\Data\Frank\Programme\Portable Python 2.7.6.1\App\Scripts\easy_install-2.7-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install-2.7')()
  File "C:\Data\Frank\Programme\Portable Python 2.7.6.1\App\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
    with_ei_usage(lambda:
  File "C:\Data\Frank\Programme\Portable Python 2.7.6.1\App\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
    return f()

我在这里做错了什么?也许移除狮身人面像会有帮助,但在easy-install中似乎没有命令开关。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-07 09:43:03

easy_install的文档非常简单。见升级包

您不需要做任何特殊的事情来升级软件包:只需安装新版本,或者通过请求特定的版本来安装,例如: easy_install "SomePackage==2.0“

所以这应该可以做到:

代码语言:javascript
复制
easy_install "Sphinx==1.6.5"

也请参见卸载软件包 with easy_install。

如果要删除包的当前安装版本(或包的所有版本),应首先运行: easy_install -m PackageName 这将确保Python不会继续搜索您计划删除的包。完成此操作后,您可以安全地删除.egg文件或目录以及希望删除的任何脚本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47690819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档