3
我有AWS,和我使用pychram-SSH部署連接到服務器。
當我運行腳本(使用鼠標右鍵 - >運行,ctrl+shift+F10
),我得到了下面的錯誤。映射路徑不工作,運行腳本SSH解釋pychram
ssh://[email protected]:22/data/anaconda/bin/python /home/user/.pycharm_helpers/pydev/pydev_run_in_console.py 0 0 C:/WC/trunk/content_dna/src/predict_hidden_layer.py
globals = run_file(file, None, None)
File "/home/user/.pycharm_helpers/pydev/pydev_run_in_console.py", line 35, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/user/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 11, in execfile
stream = tokenize.open(file) # @UndefinedVariable
File "/data/anaconda/lib/python3.5/tokenize.py", line 454, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/WC/trunk/content_dna/src/predict_hidden_layer.py'
Process finished with exit code 1
但是,如果我改變工作目錄和腳本運行/調試配置,以\home\user\PycharmProjects\content_dna\src
\home\user\PycharmProjects\content_dna\src\get_imdb_keyword.py
腳本運行完全。
我希望它是自動的,我嘗試添加在三個地方路徑映射:
- 設置 - >項目翻譯 - >編輯項目路徑映射(三點,僅適用於遠程解釋器)。
- 運行 - >編輯配置 - >默認 - > Python - >路徑映射
- 工具 - >部署 - >配置 - >映射。
現在奇怪的是,如果我嘗試使用調試(右鍵 - > Debug或Shift+F9
),沒有問題的。
我知道,無人盯防的「帶命令行的事後」解決了這個問題,但我需要這個選項。我在[youtrack]打開了一個問題(https://youtrack.jetbrains.com/issue/PY-23974),你可以贊成票這個問題。 – oshribr