当前位置:网站首页>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)、运行生成的文件会保存在服务器目录下,需要手动从服务器下载
边栏推荐
- Everyone believes that the one-stop credit platform makes the credit scenario "useful"
- MySQL45讲——学习极客时间MySQL实战45讲笔记—— 04 | 深入浅出索引(上)
- Don't spend money, spend an hour to build your own blog website
- kaggle如何使用utility script
- Solution: Compression Technology (original version and sequel version)
- QT how to set fixed size
- PyQt5_QScrollArea内容保存成图片
- Penetrate the remote connection database through the Intranet
- (POJ - 1308)Is It A Tree? (tree)
- 你的 Sleep 服务会梦到服务网格外的 bookinfo 吗
猜你喜欢

Use bloc to build a page instance of shutter

Drawing Nyquist diagram with MATLAB

Do you know that there is an upper limit on the size of Oracle data files?

The 29 year old programmer in Shanghai was sentenced to 10 months for "deleting the database and running away" on the day of his resignation!

Whole house Wi Fi: a pain point that no one can solve?

瀏覽器驅動的下載
![[to be continued] [UE4 notes] l5ue4 model import](/img/6b/d3083afc969043dbef1aeb4fccfc99.jpg)
[to be continued] [UE4 notes] l5ue4 model import

Penetrate the remote connection database through the Intranet

Halcon extract orange (Orange)

Codeforces Round #803 (Div. 2)(A~D)
随机推荐
Penetrate the remote connection database through the Intranet
kaggle如何使用utility script
P1042 [NOIP2003 普及组] 乒乓球
Qt-制作一个简单的计算器-实现四则运算-将结果以对话框的形式弹出来
Dingtalk send message
[technology development-22]: rapid overview of the application and development of network and communication technology-2-communication Technology
ArrayList and LinkedList
石子合并板子【区间DP】(普通石子合并 & 环形石子合并)
A better database client management tool than Navicat
693. 行程排序(map + 拓扑)
Everyone believes that the one-stop credit platform makes the credit scenario "useful"
[to be continued] [UE4 notes] l5ue4 model import
Codeforces Round #803 (Div. 2)(A~D)
每日学习3
D language, possible 'string plug-ins'
Design of non main lamp: how to make intelligent lighting more "intelligent"?
默认插槽,具名插槽,作用域插槽
Don't spend money, spend an hour to build your own blog website
Winter vacation daily question - lucky numbers in the matrix
Browser driven Download