Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Pycharm remote development

Shulou Source: shulou.com Published: 2022-06-03 04:51:05 10月04日 Update

Requirements: the implementation is developed on Windows10 and runs on centos7.

Configure the connection of pycharm

Tools-- > Deployment-- > Configuration... -- > the plus sign in the upper left corner

Choose a name by yourself. After selecting SFTP,OK, you will go to the configuration page.

First configure the contents of the Connection.

The connection used to add the server.

Enter the IP you want to connect to in the SFTP host and test it on the right.

Next, configure the contents of the Mappings

Configure the location in Linux where the code is stored.

View the location of the configuration project code on the Linux server

At this point, pycharm will have an extra interface.

Find the code.

In pycharm, set it to the Python environment on the Linux server

In file-> setting, add the configuration and click the settings icon in the upper right corner.

Find add remote.

Add the path, user name, and Python environment of the Linux server

Then pycharm loads the environment on Linux

After that, you can see on the interface that there is an extra Python environment after ssh.

Synchronize the code and execute the program

Upload the code to the server, otherwise the code file will not be synchronized on the server.

You can see an extra file on the right.

Use pycharm to run normally, and that's fine.

The above operation is to upload a file separately.

You can upload the entire directory to the server, right-click the project name, upload in the project on the left, and upload the entire directory.

Note:

After deleting a local file, even if the entire directory structure is uploaded synchronously, the existing code file on the server will not be deleted, so you need to manually delete the specified file in the directory structure on the right. Changes to the contents of the file can be synchronized.

After that, when you run this file again, it will run on the server side. If you want to change it back, just change the running environment of Python.

Tags: Server service file configuration code environment run directory synchronization content location right interface structure project selection development next center right again Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MariaDB Linux Redmi Huawei