“This article has participated in the good article call order activity, click to see: back end, big front end double track submission, 20,000 yuan prize pool for you to challenge!”

PyCharm remotely debuts Python projects

What? You want to see Idea remote debugging? Don’t worry, I will update you at some time. Here is the nanny style teaching, you can’t learn again, please take the initiative to quit the group chat.

When I just entered the job, the master asked me if I knew the remote debugging? I’m confused, what remote debugging? Looking at the online tutorial, writing is the process, although the configuration out, but still meng meng.

To debug Pycharm remotely, you need to know two things:

  • 1. Obtain the remote host project
  • 2. Get a remote Python environment

Get the remote host item

1. Open PyCharm

What? You want to know how to open it? Guess if I’m gonna tell you.

2. Open the Tools

Tools->Deployment->Configuration

3. Configure the IP address

Select the + sign -> SFTP and you will be prompted for a name. Enter your IP address, user name, and passwordIt is best to choose the Root Path of the directory where your application is located, such as my project WangScalerusr/local/workspace/wangscalerDown, you can configure it tousr/local/workspace/If not, you can specify the path of the project in the next Mapping.

4. Configure Mapping

Select Mapping, select your local project, and select your remote server project. The address of your project is the Root Path+ your current addressusr/local/workspace/“, then choose Wangscaler for this step.Click on the upper left corner √ select, then click on the lower right corner OK

5. Download remote projects

Tools->Deployment->Download from username @host IP will pull the code from your host.

Remember, the user you log in to must give the user permission to operate the folder. Look at the image below, which has been downloaded. Either you run or debug the project on the remote host. First of all, of course,Configuring the Remote Environment.

6. Detailed configuration

  • Upload to address: synchronize local files to a remote host
  • Download from Address: Synchronize the project on the remote host to the local computer
  • Configuration: Configures information about the remote host
  • Automatic Upload (always) : After this function is enabled, the code you modify and save Idea will be automatically synchronized to the remote host.
  • Browse Remote Host: View Remote files

Obtaining a remote environment

1. Open setting

File ->Setting That’s what the name implies.

Add a remote Python environment

Open Setting and select Project:[Project name]->Project Interpreter to see the following image. The default is your local environment

Click the pinion icon on the right and select Add

Using SSH as an example, select SSH Interpreter and enter the domain name or IP address of your remote host on the right. Enter the user name for logging in to the remote host and click Next

When the following picture is displayed, click NextCame to the place of input password, I actually forgot my password, everyone guest officer don’t worry, let me look for. After hardships and hardships, finally can not find the password, forget it, change the server, continue to explain it, you must not learn me.

Enter your password and click Next.Once you’ve entered the correct password, this step is to select your Interpreter (Python) environment and the mapping file for your local project on the remote server. This is where you want to actually launch the project when it starts later.

Choosing a Python environment

  • The Python environment installed by yum

    Python3 will be found under /usr/bin/if you have yum installed.

  • 2. Your own words

    If you can’t find python3, you can run a global search for find / -name python3.

Set up a mapping

The default is to create a folder in the temporary directory. We can also select the project we are debugging because we have downloaded our project locally, so we can directly select the project you are debugging remotely and map it to the local project. It will synchronize your local code by default.

If you select a remote project, clicking Next will prompt you to change the local to automatically override the remote code. Because our local and remote are the same, we can directly determine

run

At this point we run and debug are both running remote host projects.

Xie language

Thank you for taking the time to read this article. Read this article, is the biggest support for me, if it helps, click a like to support. My wechat official account [code farmer Share].