1.首先在Pycharm Tools->Deployment->Configurations打开

  • 新建SFTP
  • 输入host: ip地址
  • username
  • 密码
  • 然后点击Test Connection
  • 出现下图,则测试成功
    Pycharm使用远程linux服务器conda/python环境在本地进行

因为已经连接成功,这时候已经可以读取远程服务器的目录了:

Pycharm使用远程linux服务器conda/python环境在本地进行

2.选择项目mapping (可以跳过

Pycharm使用远程linux服务器conda/python环境在本地进行

3. 在Setting->Project:Intepreter中选择SSH Intepreter

Pycharm使用远程linux服务器conda/python环境在本地进行

选择Move this server to IDE settings,这样将这个intepreter对所有人都可见。

Pycharm使用远程linux服务器conda/python环境在本地进行

选择在远程的anaconda中的LSP子环境的bin中的python作为intepreter,这样可以使用在LSP中的拓展包。

Pycharm使用远程linux服务器conda/python环境在本地进行

看情况勾选 Execute code with root privileges,因为我的interpreter装在这个用户下,且我没有root用户的密码,因此我不勾选

Pycharm使用远程linux服务器conda/python环境在本地进行

加载完毕就可以看到远程的packages了。Apply之后会加载一段时间,这是mapping到本地的情况。

4.环境测试!

然后就可以在本地,使用远程环境运行程序来搞事了!
Pycharm使用远程linux服务器conda/python环境在本地进行

需要注意

每次写完代码都记得要upload文件,当然也可以使用auto synchronize

相关文章:

  • 2021-06-04
  • 2021-08-24
  • 2021-09-26
  • 2021-08-05
  • 2022-12-23
  • 2022-01-20
  • 2022-01-09
猜你喜欢
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-07-04
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案