2017-01-25 66 views
0

當嘗試使用PIP我收到以下錯誤,安裝特定版本的任何依賴PIP安裝顯示語法錯誤:時指定版本

(myvenv) D:\Project\on-staging>pip install Fabric==1.4.3 
Collecting Fabric==1.4.3 
    Using cached Fabric-1.4.3.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "C:\Users\Admin\AppData\Local\Temp\pip-build-39la41_8\Fabric\setup.py", line 7, in <module> 
     from fabric.version import get_version 
     File "C:\Users\Admin\AppData\Local\Temp\pip-build-39la41_8\Fabric\fabric\version.py", line 104 
     print get_version('all') 
         ^
    SyntaxError: invalid syntax 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-build-39la41_8\Fabric\ 

pip install Fabric工作正常不過。

+3

您試圖在Python 3中運行Python 2代碼。它們不兼容。 – TigerhawkT3

+0

你使用的是哪個'Python'版本? 'Fabric'只兼容'Python2.5'到'Python 2.7' –

+0

嘗試使用與Python 3兼容的Fabric3 –

回答

0

降級的python 2.7解決的問題對我來說, 或 安裝python 2.7, 不要將它添加到路徑(環境變量), 創建新的虛擬環境中使用Python 2.7。