PyCharm is a strong IDE for python programmer. Not only because it has a similar face with VS or some other IDEs, but also it provides a convenient way to remote manage codes.

But... how to configure it to achieve this is a headache problem. Here I saved a good guidebook.

0. A professional version must be needed.

Community version PyCharm has no remote management function. Luckily, I am a student yet so I can use my edu.cn email address to use the professional version for free.

1. Some explicit concepts should be understood.

Here are two concepts may help you have an overall view, Interpreter and Deployment.

An interpreter is used to run python code. Obviously, you should use your server interpreter to do this instead of running on your local computer. So the first thing you have to do is setting interpreter of PyCharm.

And what makes PyCharm so charming is exactly Deployment. Actually, it is a GitHub-like thing. With it, you can pull code from the server and push edited version back. What you need to do is tell Deployment where are your local codes and remote codes. Yes, just two paths.

2. Now we can do it.

(1) Create a new project with PyCharm. Your local codes will be saved in this project.

(2) Interpreter Configuration: Open the new project in PyCharm. Click File -> Settings -> Project: xxx -> Project Interpreter. Now you can find the project interpreter. Click the gear-shaped button, choose to add. Here we should add an SSH interpreter. Input your Host address and username. The things behind are too simple to descript here.

(If you use Anaconda rather than system interpreter, you can refer to 3(1) below.)

(3) Deployment Configuration: Click Tools -> Deployment -> Configuration. Now you can configure Deployment. Here are three tabs named Connection, Mappings and Excluded Paths. The connection is some information to link your server. And mapping is a corresponding relationship between a local project path with the server project path. Just two root directories' paths.

3. More tricks.

(0) A virtual environment is better. You can use Anaconda to create a virtual environment on the server, then link it in the PyCharm Interpreter. The system interpreter path is /usr/bin/python, but the Anaconda interpreter path is anaconda3/envs/{ENV_NAME}/bin/python.

(1) In the terminal tab of PyCharm, you can use SSH command to log in your server.

(2) Maybe you cannot run via clicking the green triangle button. You should use Run in the menu bar.

(3) If some problems happened when you are running codes, it may because your server interpreter environment is wrong configuring. Make sure you can run codes correctly on your server before running it in the PyCharm.

Reference:

http://www.xzhewei.com/Tutorial-%E6%95%99%E7%A8%8B/remote-debug/

https://www.xncoding.com/2016/05/26/python/pycharm-remote.html

PyCharm Notes | PyCharm 使用笔记(远程访问服务器code配置指南)的更多相关文章

  1. 【转】CentOS 6 服务器安全配置指南

    原文连接: CentOS 6 服务器安全配置指南(通用) Linux 是一个开放式系统,可以在网络上找到许多现成的程序和工具,这既方便了用户,也方便了黑客,因为他们也能很容易地找到程序和工具来潜入 L ...

  2. [转帖]CentOS 6 服务器安全配置指南(通用)

    CentOS 6 服务器安全配置指南(通用) http://seanlook.com/2014/09/07/linux-security-general-settings/  发表于 2014-09- ...

  3. Visual Studio Code 配置指南

    Visual Studio Code (简称 VS Code)是由微软研发的一款免费.开源的跨平台文本(代码)编辑器.在我看来它是「一款完美的编辑器」. 本文是有关 VS Code 的特性介绍与配置指 ...

  4. Windows服务器安全配置指南

    1).系统安全基本设置 2).关闭不需要的服务 Computer Browser:维护网络计算机更新,禁用 Distributed File System: 局域网管理共享文件,不需要禁用 Distr ...

  5. 苹果ATS特性服务器证书配置指南

    配置指南: 需要配置符合PFS规范的加密套餐,目前推荐配置: ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!AD ...

  6. Python入门学习指导(VS Code配置向)

    代码编辑器或IDE 推荐Vs Code,Atom和Sublime(本文以Vs Code为例,Sublime对中文支持不是很好,时常弄好了Sublime的乱码,却在复制到其他编辑器时出了问题) Vs C ...

  7. Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基础文件配置,Web框架的本质,服务器程序和应用程序(wsgiref服务端模块,jinja2模板渲染模块)的使用

    Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基 ...

  8. 通过web远程访问服务器的ipython

    如果想同过一个Web浏览器的方式远程访问服务器上的ipython notebook sever,可通过下面的步骤实现. 服务器:ubuntu14.04 server 客户端:windows/unix/ ...

  9. 笔记:服务器压缩方案 来源于 Accept-Encoding: gzip, deflate 问题

    笔记:服务器压缩方案 来源于 Accept-Encoding: gzip, deflate 问题 事情起因:odoo demo 没有启动web 压缩 目前流行的 web 压缩技术 gzip br 支持 ...

随机推荐

  1. 腾讯蔡晨:十年沉淀,腾讯iOA为企业安全保驾护航

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 背景:5月23-24日,以"焕启"为主题的腾讯"云+未来"峰会再广州召开,广东省各级政府机构领导.海 ...

  2. 深入理解JavaScript系列(21):S.O.L.I.D五大原则之接口隔离原则ISP

    前言 本章我们要讲解的是S.O.L.I.D五大原则JavaScript语言实现的第4篇,接口隔离原则ISP(The Interface Segregation Principle). 英文原文:htt ...

  3. 简单springboot及springboot cloud环境搭建

    springboot使用特定的方式,简化了spring的各种xml配置文件,并通过maven或者gradle,完成所需依赖,使用springboot maven插件,可直接输出可运行的jar包,省去了 ...

  4. Windows无法启动MySQL服务,错误1067

    问题:mysql服务启动异常 找出原因 检查D:\mysql-5.6.20-winx64\data目录下client-02.err文件的错误信息(以err为后缀名的文件是mysql的日志文件) 修改配 ...

  5. 3..net可以做什么

    .net可以做什么呢? (1)桌面应用程序  Winform(.net开发的桌面应用程序叫winform应用程序) (2)internet应用程序 ASP.net(.net开发的internet应用程 ...

  6. Spring课程 Spring入门篇 5-2 配置切面aspect

    本节主要讲了在xml中配置切面的demo 1 解析 1.1 配置切面xml 1.2 配置切面xml 1.3 问:什么是动态代理? 2 代码演练 2.1 配置切面xml 1 解析 1.1 配置切面xml ...

  7. learn OpenStack by picture

  8. SharePoint 2013 - Client Side Rendering

    1. Client side rendering 代码结构为: (function () { // Create object that have the context information ab ...

  9. 【Linux】sudo用户权限管理

    权力下放 一.权力分配- sudo Sudo是Unix/Linux平台上的一个非常有用的工具,它允许系统管理员分配给普通用户一些合理的"权力",让 他们执行一些只有超级用户或其他特 ...

  10. html表格设置

    表格 表格由 <table> 标签来定义.每个表格均有若干行(由 <tr> 标签定义),每行被分割为若干单元格(由 <td> 标签定义).字母 td 指表格数据(t ...