2014-02-18 26 views

回答

14

答案是肯定的。
我們只需要wheel包,我們甚至不需要安裝它,因爲根據docs,我們可以直接使用它(由於.whl文件具有相同的格式,.zip文件和Python可以在.zip文件運行代碼直接):

[email protected]:~$ python ./wheel-0.22.0-py2.py3-none-any.whl/wheel -h 
usage: wheel [-h] 

      {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help} 
      ... 

positional arguments: 
    {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help} 
         commands 
    keygen    Generate signing key 
    sign    Sign wheel 
    unsign    Remove RECORD.jws from a wheel by truncating the zip 
         file. RECORD.jws must be at the end of the archive. 
         The zip file must be an ordinary archive, with the 
         compressed files and the directory in the same order, 
         and without any non-zip content after the truncation 
         point. 
    verify    Verify a wheel. The signature will be verified for 
         internal consistency ONLY and printed. Wheel's own 
         unpack/install commands verify the manifest against 
         the signature and file contents. 
    unpack    Unpack wheel 
    install    Install wheels 
    install-scripts  Install console_scripts 
    convert    Convert egg or wininst to wheel 
    version    Print version and exit 
    help    Show this help 

optional arguments: 
    -h, --help   show this help message and exit 

現在,我們要做的是使用convert參數,並通過雞蛋轉換:

[email protected]:~$ python ./wheel-0.22.0-py2.py3-none-any.whl/wheel convert ./my-egg.egg 

感謝保羅·穆爾提供answer在virtualenv的小組和Ivo提供#pip irc頻道的更多細節。