PyCharm连接服务器 - 2
发布时间:2024年01月13日
PyCharm连接服务器-2
【注】该连接服务器的方法适用于代码在我们的本地,我们可以直接利用pycharm上传代码到服务器,或者直接使用服务器的环境跑我们的实验。
1.如何连接服务器?
- 【Tools】->【Deployment】->【Configuration】





SSH认证代理配置方法

2.如何在终端窗口打开SSH连接?
- 【Tool】->【Start SSH Session】


- PyCharm的Terminal显示服务器信息,即表示已连接远程服务器,可进行终端操作。

3.Terminal终端出现中文乱码的解决办法?

- 【Tools】->【SSH Terminal】->【修改 Default enconding 为 UTF-8】

4.如何查看远程服务器的树目录结构?
- 【Tools】->【Deployment】->【Browse Remote Host】

- 在pycharm的右侧可以看到服务器的树目录结构。

5.如何配置代码同步?
如果想将自己本地的代码上传至服务器,可以按照下面的步骤进行配置。
- 选择【Mappings】页面,配置本地项目所在路径和远程服务器项目所在路径(服务器路径就是上传项目至服务器的位置)。

同步代码:

- 【Tools】->【Deployment】->【Upload to you_server_name】,将本地的代码上传到远程服务器。

- 【Tools】->【Deployment】->【Download from you_server_name】,从远程服务器拉取代码到本地。
- 【Tools】->【Deployment】->【Compare with Deploved Version on you_server_name】,查看本地与远程服务器代码的区别。
- 【Tools】->【Deployment】->【Sync with Deployed to you_server_name】,将修改后的代码同步到服务器。

6.如何为项目配置远程服务器中的python解释器?
- 左上角【File】->【Settings】->【Project】->【Python Interpreter】->【Add Interpreter】->【On SSH Interpreter】


- 选择是在服务器上新创建环境还是使用服务器上已经存在的环境。

- Virtualenv Environment(虚拟环境):一个用来创建隔离的Python环境的工具。Virtualenv创建的环境拥有它自己的安装目录,并且不会与其他virtualenv环境共享库(并且也可以选择不访问全局安装的库)。
- System Interpreter(系统解释器):是安装在系统上的默认Python解释器。使用系统解释器时,使用的是操作系统上安装的Python版本以及所有全局安装的包。
- Conda Environment(Conda环境):Anaconda 的 conda 虚拟环境。Anaconda配置清华镜像、Anaconda命令汇总、多版本CUDA与cuDNN的安装
😃😃😃
文章来源:https://blog.csdn.net/weixin_48958956/article/details/135576317
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:chenni525@qq.com进行投诉反馈,一经查实,立即删除!