How to use PyCharm with Google compute engine(如何将 PyCharm 与 Google 计算引擎一起使用)
本文介绍了如何将 PyCharm 与 Google 计算引擎一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个在谷歌云平台上运行的计算引擎实例.
I have a compute engine instance running on Google cloud platform.
我想将计算引擎的 Python 解释器用作 Pycharm 的远程解释器.这意味着我将在本地机器上使用 Pycharm 并远程运行计算.
I would like to use the Python interpreter of the compute engine as a remote interpreter with Pycharm. This means that I would be using Pycharm on my local machine and running computations remotely.
关于如何实现这一点的任何线索?
Any clue on how to achieve this?
推荐答案
以下要求,如 James Hirschhorn指出,PyCharm 的专业版.
The following requires, as James Hirschhorn pointed out, the Professional verison of PyCharm.
- 为 GCP 上的远程计算机分配一个公共 IP.
- 运行
gcloud compute config-ssh自动将您项目的虚拟机添加到您的~/.ssh/config或手动将您的虚拟机的公共 IP 添加到它.如果您跳过了第 1 步,那么您必须在每次重新启动远程 VM 时运行gcloud compute config-ssh,因为它总是会获得分配的新 IP.~/.ssh/config填充了以下格式的许多条目:
- Assign a public IP to the remote machine on GCP.
- Run
gcloud compute config-sshto automatically add the VMs of your project to your~/.ssh/configor manually add the public IP of your VM to it. If you skipped step 1. then you have to rungcloud compute config-sshevery time you re-start the remote VM, because it always gets a new IP assigned. The~/.ssh/configgets populated with many entries in the following format:
Host the-vm-host-name # use this in PyCharm's Host field
HostName 123.456.789.00 # the VM's IP address
Host 名称python.这篇关于如何将 PyCharm 与 Google 计算引擎一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
编程基础网
本文标题为:如何将 PyCharm 与 Google 计算引擎一起使用
基础教程推荐
猜你喜欢
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
