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. (转)IPC相关的命令

    IPC相关的命令 原文:http://www.cnblogs.com/jjzd/p/6773090.html 进程间通信概述 进程间通信有如下的目的: 1.数据传输,一个进程需要将它的数据发送给另一个 ...

  2. 【Ubuntu】ubuntu 16.04 设置root用户初始密码

    安装ubuntu成功后,都是普通用户权限,并没有最高root权限,如果需要使用root权限的时候,通常都会在命令前面加上 sudo . 我们一般使用su命令来直接切换到root用户的,但是如果没有给r ...

  3. Git代码merge

    Git代码合并遇到如下问题: <<<<<<< HEAD     client.post(url, secretKey, function (data, res ...

  4. Java 重写hashCode() 时为什么要用 31 来计算

    在OSChina 中看到了一篇文章<Java 中正确使用 hashCode 和 equals 方法>,看到 hashCode 的方法体内的31比较有意思. 在Stackoverflow上找 ...

  5. 在MVC中使用Bundle打包压缩js和css

    第一步:安装 安装“System.Web.Optimization”:在中“NuGet”中搜索 安装. 第二步:配置 配置“Views”目录下的“web.config”文件增加“System.Web. ...

  6. mvc页面间的传值

    本文大致讲解mvc前后端的传值方式,包括control向view.view向control.以及action向action. 回顾 我们回顾下在ASP.NET WebForms中,页面之间最常用的传值 ...

  7. Android应用开发基础之五:网络编程(二)

    HttpClient 发送get请求 创建一个客户端对象 HttpClient client = new DefaultHttpClient(); 创建一个get请求对象 HttpGet hg = n ...

  8. FlexPaper实现文档在线浏览(附源码)

    园子里也有关于FlexPaper的文章,但都不怎么详细. 没有较全的参数说明.就连官方网站都没有.没法,最后只得将swf文件反编译后查看了源码才将里面的参数全部弄出来. 好了,废话不多说,开始正题. ...

  9. Flask入门request session cookie(二)

    1 HTTP方法分类 1 GET 浏览器告知服务器:只获取页面上的信息并发给我.这是最常用的方法. 2 HEAD 浏览器告诉服务器:欲获取信息,但是只关心消息头 .应用应像处理 GET 请求一样来处理 ...

  10. PowerBuilder与嵌入浏览器交互

    准备工作1. 新增一个Application应用,新增一个窗口.2. 在窗口中新增一个OLE控件:Microsoft Web Browser,命名为old_1.3. 新增一个TextBox网址输入控件 ...