【发布时间】:2017-09-22 03:13:25
【问题描述】:
我有 AWS,我正在使用 pychram-ssh-deployment 连接到服务器。
当我运行脚本(使用右键单击 -> 运行,ctrl+shift+F10)时,出现以下错误。
ssh://user@xxx.xx.x.xx: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 -> 路径映射
- 工具 -> 部署 -> 配置 -> 映射。
现在奇怪的是,如果我尝试使用调试(右键单击 -> 调试或Shift+F9),完全没有问题。
【问题讨论】:
标签: python amazon-web-services ssh pycharm