簡體   English   中英

使用easy_install升級Python Sphinx

[英]Upgrade Python Sphinx with easy_install

我正在使用Portable Python 2.7.6.1,並安裝了Sphinx 1.5.1以創建手冊。 由於Sphinx在過去的幾個月中已經取得了很大的進步,因此我試圖更新到最新版本的Sphinx 1.6.5,但是我無法使用easy_install工具進行升級。

我試過了:

easy_install-2.7.exe -U sphinx

它說:

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

之后,我嘗試強制使用該版本,但這也失敗了:

easy_install-2.7.exe -m 1.6.5 sphinx

這就是說的:

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為此的命令開關。

easy_install的文檔非常簡單。 請參閱升級軟件包

您無需執行任何特殊操作即可升級軟件包:只需通過請求特定版本即可安裝新版本,例如:

 easy_install "SomePackage==2.0" 

因此,應該這樣做:

easy_install "Sphinx==1.6.5"

另請參閱使用easy_install 卸載軟件包

如果要刪除軟件包的當前安裝版本(或軟件包的所有版本),則應首先運行:

 easy_install -m PackageName 

這樣可以確保Python不會繼續搜索您打算刪除的軟件包。 完成此操作后,您可以安全地刪除.egg文件或目錄以及要刪除的所有腳本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM