Pycharm远程访问开发调试配置

一、本地安装Pycharm及Anaconda

1、Pycharm下载:https://download.jetbrains.8686c.com/python/pycharm-professional-2019.2.2.exe,按要求安装即可

2、Anaconda下载:https://repo.anaconda.com/archive/Anaconda3-2019.07-Windows-x86_64.exe,按照要求安装即可

注意:有时存在安装时选择了添加环境变量,在cmd仍然无法定位到anaconda的问题,此时将anaconda的路径添加到环境变量即可,网上有教程。

二、Pycharm建立Project

操作:File\rightarrowNew Project\rightarrowCreate

三、Pycharm建立服务器Connection

1、操作:Tools\rightarrowDeployment\rightarrowConfiguration\rightarrowSFTP\rightarrowNew server name填写\rightarrowOK

2、配置如下:

#第一种情况,远程连接的服务器可以访问内网(host-accessible)
host:host-accessible-ip
port:host-accessible-port
username:host-accessible-username
password:host-accessible-password
root path:host-accessible定位的路径

#第二种情况,远程连接的服务器不能访问内网(host-inaccessible),通过SSH隧道技术建立中转服务器(host-accessible)
host:host-accessible-ip
port:host-accessible-port(SSH隧道建立的port,不是中转服务器port)
username:host-inaccessible-username
password:host-inaccessible-password
root path:host-inaccessible定位的路径

3、配置完成后可通过test connection测试远程连接

4、前文建立的本地Project(Local path)和远程服务器项目(Deployment path)连接

Local path:绝对路径;Deployment path:相对root path的路径

 5、点击OK,完成远程连接

三、配置远程连接工作Python解释器

File\rightarrowSettings\rightarrowConfiguration\rightarrowProject:untitled3\rightarrowProject interpreter\rightarrowadd\rightarrowSSH interpreter\rightarrowExisting server configuration\rightarrow选择前面配置的host-inaccessible(gpu)\rightarrowmove\rightarrownext\rightarrowfinish\rightarrowOK

四、本地和服务器文件同步

同步到本地:Remote host\rightarrow文件右键点击\rightarrowDownload from here

上传到服务器:Project file\rightarrow文件右键点击\rightarrowDeployment\rightarrowUpload to ...

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值