文章目录
- 一、PyCharm远程调试Python
-
- 远程部署配置
- 远程解释器配置
- 工作中问题总结
-
- pycharm远程服务器运行Can‘t run remote python interpreter:Can‘t get remote credentials for deployment server
- 二、参考
一、PyCharm远程调试Python
默认情况下我们在本地开发Python程序时,使用的是本地的Python解释器,如果你安装了virtualenv或者pyenv的话,还可以选择这些虚拟环境。而使用Pycharm的专业版,则还可以选择使用远程Linux机器上的解释器。下面就来介绍下使用远程解释器的步骤。
远程部署配置
远程部署主要用于本地代码与远程服务器上的代码进行同步,使得的本地代码在经过修改后,可以很容易的同步到远程服务器上。因为只有本地代码和远程服务器上的代码一致时,才能正确使用远程解释器进行调试。
选择Tools -> Deployment -> Configuration…
添加sftp
添加ssh
远程解释器配置
远程部署仅仅只是同步和拷贝文件,而真正支持远程调试的则是远程解释器。
在Pycharm中选择File -> Settings -> Project:xxx -> Project Interpreter -> Add Remote
选择使用远程解释器
注意:需要保证解释器的地址是正确的,而且path mappings也是对的
PyCharm配置远程python解释器可以实现:
- 可以指定本地某目录和服务器某工作目录对应起来,可以直接在本地机子上修改服务器工作目录下面的代码文件,即可以直接在IDE(如PyCharm)中修改服务端的代码,保持两处的代码同步修改。
- 为PyCharm配置远程python解释器,可以在本地的IDE中运行服务端的代码,并且可以在IDE中查看运行结果,不再需要ssh 连接到远程服务器执行代码。
工作中问题总结
pycharm远程服务器运行Can‘t run remote python interpreter:Can‘t get remote credentials for deployment server
pycharm远程服务器运行Can‘t run remote python interpreter:Can‘t get remote credentials for deployment server
参考URL:https://blog.csdn.net/weixin_44633882/article/details/100635364
需要保证解释器的地址是正确的,而且path mappings也是对的
二、参考
Pycharm配置远程调试
参考URL: https://blog.csdn.net/five3/article/details/78615589