当前位置:网站首页>Pycham connects to the remote server and realizes remote debugging
Pycham connects to the remote server and realizes remote debugging
2022-04-23 16:36:00 【Sink the wine cup and fleeting time】
Pycharm Connect to the remote server and realize remote debugging
Connect to remote server
1、 Click on Tools
( Tools ), Click on Deploy Deployment
( Deploy ), Click on Configuration
( To configure )
2、 Add a new one SFTP Link to agreement
3、 Name the link
4、 Configure server information
choice Connection
tab page , Enter the remote server address 、 User name and password , Click on Test Connection
( Test connection )
If the pop-up connection is successful , Indicates that the connection to the remote server is configured successfully
5、 Configure synchronization content
choice Mappings
tab page , Configure the path where the local project is located and the path where the remote server project is located . In this way, as long as one party makes modifications , Code can be synchronized manually
6、 Open at terminal SSH Connect
Click on Tools
( Tools ), Click on Deploy Start SSH session
Select the remote server to connect to
If pycharm
Of Terminal
The terminal displays the corresponding server information , Indicates that the remote server is connected , It can be the same as in the server terminal , To operate
Be careful : If pycharm
Of Terminal
Chinese garbled code appears on the terminal , Then it needs to be modified pycharm
Of Tools
To configure
Click on the top left corner Files
→ Settings
, Click on Tools
, Change the format to utf-8
7、 View the remote server directory structure
Click on Tools
( Tools ), Click on Deploy Deployment
( Deploy ), Click on Browse Remote Host
( Browse remote hosts )
stay pycharm
Of You can view the directory structure of the remote server on the right
Synchronization code
Click on Tools
( Tools ), Click on Deploy Deployment
( Deploy )
-
If you want to synchronize your code to a remote server , Click on
Upload to deepin
(deepin Is the name of the remote host ) -
If you want to pull code from a remote server , The click
Download from deepin
(deepin Is the name of the remote host ) -
If I check that
Automatic Upload (always)
, that , You modified the code locally ,pycharm
The code will be automatically synchronized to the remote server ( This is not recommended in real projects , Will cause code conflicts , Of course , Will be used in real projects git. Your own private server doesn't matter )
Configure the remote interpreter for debugging
In some cases , In the remote server ,python Some library versions of the interpreter are inconsistent with the local version , perhaps Windows Some libraries and Linux Some libraries under are different , It will cause the code to run normally locally , But running on the remote server is abnormal .
This situation , You can go to pycharm Configure... In the remote server in python Debug the interpreter
1、 Click on the top left corner Files
→ Settings
, Click on Project Interpreter
, Click on Add
2、 choice SSH Interpreter
, choice Existing server configuration
, Select the remote server
3、 To configure Python The path of the interpreter
In general , Selected Python The interpreter version is python3, Path is /usr/bin/python3
If the virtual environment is also configured on the remote server , Then you can select the directory where the virtual environment is located python3 file
版权声明
本文为[Sink the wine cup and fleeting time]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231402128548.html
边栏推荐
- vim编辑器的实时操作
- OAK-D树莓派点云项目【附详细代码】
- Force buckle-746 Climb stairs with minimum cost
- VMware Workstation cannot connect to the virtual machine. The system cannot find the specified file
- There is a problem with the light switch from 1 to 100
- Download and install mongodb
- Day (4) of picking up matlab
- Real time operation of vim editor
- Questions about disaster recovery? Click here
- 1959年高考数学真题
猜你喜欢
无线鹅颈麦主播麦手持麦无线麦克风方案应当如何选择
loggie 源码分析 source file 模块主干分析
Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
Installation and management procedures
磁盘管理与文件系统
Real time operation of vim editor
MySql主从复制
1959年高考数学真题
Research and Practice on business system migration of a government cloud project
Use if else to judge in sail software - use the title condition to judge
随机推荐
05 Lua 控制结构
第十天 异常机制
Report FCRA test question set and answers (11 wrong questions)
vim编辑器的实时操作
Day (5) of picking up matlab
深度学习100例 | 第41天-卷积神经网络(CNN):UrbanSound8K音频分类(语音识别)
UWA Pipeline 功能详解|可视化配置自动测试
LVM与磁盘配额
Using JSON server to create server requests locally
OAK-D树莓派点云项目【附详细代码】
文件操作详解(2)
Interview question 17.10 Main elements
Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
面试题 17.10. 主要元素
Take according to the actual situation, classify and summarize once every three levels, and see the figure to know the demand
RecyclerView advanced use - to realize drag and drop function of imitation Alipay menu edit page
MySql主从复制
[key points of final review of modern electronic assembly]
linux上启动oracle服务
1959年高考数学真题