2013-08-18 29 views
1

在運行NPM安裝(例如https://github.com/donpark/html2jade),I碰上此錯誤:警告: '作爲' 將成爲保留關鍵字在Python 2.6

/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:852: Warning: 'as' will become a reserved keyword in Python 2.6 
Traceback (most recent call last): 
    File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp", line 15, in <module> 
    import gyp 
    File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module> 
    import gyp.input 
    File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 852 
    except ImportError as e: 
         ^
SyntaxError: invalid syntax 

蟒--version產生 '的Python 2.7.1'

回答

0

這不會是Python 2.7.1中的語法錯誤。一個快速的解決方法是運行這個程序爲python /full/path/to/scriptname.py,它實際上會使用Python 2.7.1。

+0

感謝您的反饋,但此代碼嵌入到從Internet上加載文件的package.json文件中。任何線索如何推動Python 2.7.1的使用? – Abdelkrim

相關問題