2014-01-22 24 views
2

使用Windows 7,Python的3.2和崇高文本2Sublime2和SublimeREPL

我經歷了所有的指令去安裝SublimeREPL,當我去Tools -> SublimeREPL -> Python -> Python我得到一個錯誤:「WindowsError(2,「系統無法。找到speificed文件')我去了常見問題,並添加以下(完全按照規定),用戶偏好:

{ 
... 
"default_extend_env": {"PATH": "C:/Python32"} 
... 
}` 

當我試圖挽救我得到另一個錯誤的文件:「錯誤嘗試解析設置:預期值...「,並指向SublimeREPL文件。

整個文件是自帶的安裝通用版本:

{ 
// default_extend_env are used to augment any environment variables 
// that should be visible for all subprocess repls launched within 
// SublimeREPL. This is a very good place to add PATH extension 
// once "PATH": "{PATH}:/home/username/mylocalinstalls/bin" or whatever 
"default_extend_env": {}, 

// Specify whether to move repls to a different Sublime Text group (frame) 
// immediately on opening. Setting this to true will simply move it to 
// the 'next' group from the one that was in focus when it was opened 
// (one down with row layout, one to the right with column and grid 
// layout). Alternatively, you can set this to the index of the group in 
// which you want all repls to be opened (index 0 being the top-left group). 
// Activating this option will NOT automatically change your layout/create 
// a new group if it isn't open. 
"open_repl_in_group": true, 

// Persistent history is stored per REPL external_id, it means that all python 
// REPLS will share history. If you wish you can disable history altogether 
"persistent_history_enabled": true, 

// By default SublimeREPL leaves REPL view open once the underlying subprocess 
// dies or closes connection. This is useful when the process dies for an unexpected 
// reason as it allows you to inspect it output. If you want. Setting this 
// to true will cause SublimreREPL to close view once the process died. 
"view_auto_close": false, 

// Some terminals output ascii color codes which are not currently supported 
// enable this option to filter them out. 
"filter_ascii_color_codes": true, 

// Where to look for python virtualenvs 
"python_virtualenv_paths": [ 
    "~/.virtualenvs", // virtualenvwrapper 
    "~/.venv" // venv.bash https://github.com/wuub/venv 
], 

// Use arrows for history navigation instead of Alt+[P|N]/Ctrl+[P|N] 
"history_arrows": true, 

// standard sublime view settings that will be overwritten on each repl view 
// this has to be customized as a whole dictionary 
"repl_view_settings": { 
    "translate_tabs_to_spaces": false, 
    "auto_indent": false, 
    "smart_indent": false, 
    "spell_check": false, 
    "indent_subsequent_lines": false, 
    "detect_indentation": false, 
    "auto_complete": true, 
    "line_numbers": false, 
    "gutter": false 
}, 

// this settings exposes additional variables in repl config files, especially 
// those related to sublime projects that are not available through standard API 
// WARNING: this will switch your build system back to Automatic each time a REPL 
// is started so beware! 
"use_build_system_hack": false, 

// IP address used to setup autocomplete server in sublimerepl. 
// changing this is usefull when you want to exclude one address 
// from proxychains/tsocks routing 
"autocomplete_server_ip": "127.0.0.1", 

// Mapping is used, when external_id of REPL does not match 
// source.[xxx] scope of syntax definition used to highlight 
// files from which text is being transfered. For example octave 
// repls use source.matlab syntax files and w/o this mapping text transfer 
// will not work 
"external_id_mapping": { 
    "octave": "matlab" 
}, 

// If set to true, SublimeREPL will try to append evaluated code to repl 
// output before evaluation (e.g. Ctrl+, f) 
"show_transferred_text": false 

}

我試圖用Python來評估Sublime2選擇的代碼。

以上是我添加到用戶文件(SublimeREPL.sublime-settings - User)的內容。除了我添加的內容外,文件中沒有其他內容。

+0

當您保存python腳本或用戶首選項文件時,是否收到錯誤「嘗試解析設置錯誤...」? –

+0

請編輯您的問題併發布您的整個'SublimeREPL.sublime-settings'文件,以便我們可以看到錯誤可能是什麼。 – MattDMo

+0

@AshokaLella我得到它節省用戶文件 – CJ12

回答

6

Sublime REPL默認從windows系統路徑中選取python。您可以通過以下this

如果你想在SublimeREPL.sublime的設置您需要將線路改爲

"default_extend_env": {"PATH":"{PATH};c:\\Python32"}, 
  1. 既然你在Windows是改變設置這個路徑你「會需要保存‘\’字符使用轉義‘\\’
  2. * SublimeREPL.sublime的設置是一個JSON文件,因此預計」,」末
  3. 「{PATH};」部分是可選的。它允許您將Python路徑添加到現有路徑,而不是覆蓋它。
+0

當我運行R時,同樣的事情發生,這是否意味着我不得不每次手動切換路徑? – CJ12

+1

您需要修改'{「PATH」:「{PATH}; c:\\ Python32」}'到'{「PATH」:「{PATH}; c:\\ Python32; c:\\ path \ \到\\ R「}' –