当前位置:网站首页>Pycharm连接远程服务器
Pycharm连接远程服务器
2022-07-02 10:35:00 【Dear_林】
由于linux服务器上无法直接使用pycharm,所以解决的方法是利用windows安装的pycharm远程链接linux服务器。
步骤如下:
1、pycharm工具栏:Tools–>Deployment–>Configuration
2、左上角:点击+加号–>SFTP(最好选择这个)
3、给链接命名(自定义)
4、选择新建的连接–>Connection–>输入服务器、登录信息–>Test connection,测试能否连接成功。
连接成功后,会弹出如下窗口,否则会是其他信息
5、在上面的窗口中:点击–>Mappings,设置工作目录路径设置好后,点击确定
6、现在可以进行文件的上传和下载工作了(此时还不能进行代码运行,因为还没有配置解释器环境–见步骤7)
7、配置解释器
要想运行代码,还需要配置python(根据自己的语言定)解释器环境:
File–>Settings
Project:…–>Project Interpreter -->Add
SSH Interpreter–>输入服务器地址,端口号,用户名–>next
输入密码–>next
选择解释器目录,点击完成即可。
解释器目录最好选择服务器上虚拟环境下的Python安装地址
在服务器上用conda env list查看现有虚拟环境的地址,选择项目所用的虚拟环境
选择解释器目录:
8、检测能否成功运行
可以通过os,看能否浏览服务器上的文件目录
import osos.listdir(‘/home/user/localproject/project’) # 随便输入一个你的服务器文件目录
如果输出的文件列表是你的服务器上的文件,则完成了配置。
9、其他说明:
1)、设置好本地工作目录和自动上传后,文件会自动上传当前(设置了服务器解释器的工程)到设置的目录。
然后操作本地的文件(重命名、修改编写代码、删除文件),服务器也会同步修改。但这些都要保证是在pycharm里面操作。如果是在windows里面操作的话,不会自动同步。
同步日志详情可以在左下角的 File Transfer 里面看到
2)、运行生成的文件会保存在服务器目录下,需要手动从服务器下载
边栏推荐
- 【模板】最长公共子序列 (【DP or 贪心】板子)
- Android kotlin fragment technology point
- Design of non main lamp: how to make intelligent lighting more "intelligent"?
- Use bloc to build a page instance of shutter
- 2022 home projector preferred! Dangbei F5 brings the ultimate audio-visual experience with its powerful audio-visual effect
- Qt入门-制作一个简易的计算器
- Daily practice of C language --- monkeys divide peaches
- Just 1000 fans, record it
- Error: eacces: permission denied, access to "/usr/lib/node_modules"
- 无主灯设计:如何让智能照明更加「智能」?
猜你喜欢

ensp简单入门

The conference on the growth of all things was held in Hangzhou, and dangbei was selected into the top 100 list of future unicorns in China in 2022

Origin plots thermogravimetric TG and differential thermogravimetric DTG curves

抓包工具fiddler学习

无主灯设计:如何让智能照明更加「智能」?
![[Hongke technology sharing] how to test DNS server: DNS performance and response time test](/img/f4/d8c21d6c33985fd6d819cd44c22c72.png)
[Hongke technology sharing] how to test DNS server: DNS performance and response time test

C crystal report printing

Just 1000 fans, record it

Selenium element positioning method

Mysql5.7 installation super easy tutorial
随机推荐
Codeforces Round #803 (Div. 2)(A~D)
千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
Packet capturing tool Fiddler learning
【模板】最长公共子序列 (【DP or 贪心】板子)
Selenium element positioning method
MySQL 45 lecture - learning the actual battle of MySQL in Geek time 45 Lecture Notes - 05 | easy to understand index (Part 2)
抓包工具fiddler学习
Do you know that there is an upper limit on the size of Oracle data files?
Essential elements of science fiction 3D scenes - City
BeanUtils--浅拷贝--实例/原理
Getting started with QT - making a simple calculator
你的 Sleep 服务会梦到服务网格外的 bookinfo 吗
Code implementation MNLM
P1908 reverse sequence pair
Selenium installing selenium in pycharm
Android kotlin fragment technology point
故事點 vs. 人天
全屋Wi-Fi:一个谁也解决不好的痛点?
693. 行程排序(map + 拓扑)
QT - make a simple calculator - realize four operations