问题描述
我的 PC 上有一个正在运行的 Python 项目,它是从 Pycharm 运行的.它使用 Pyroot(Root C++ 库的接口),我在 Pycharm 的项目设置/Python 解释器/路径中添加了其 C++ 库路径.它还需要使用 2.7 Python 解释器,而不是 3.,这是我终端中的默认 Python.
I have a working Python project on my PC, which I am running from Pycharm.It uses Pyroot (an interface to Root C++ library), whose C++ lib path I have added in Project Settings/Python Interpreter/Paths in Pycharm. It also needs to use the 2.7 Python interpreter, instead of 3., which is a default python in my terminal.
我想在另一个桌面上远程运行这个项目,所以我需要能够从终端运行它,指定 Root 路径和解释器版本.
I want to run this project remotely on another desktop, so I need to be able to run it from terminal specifying the path to Root and the interpreter version.
当我通过运行按钮运行代码时,有没有一种方法可以轻松地从 Pycharm 中提取它正在使用的确切运行命令?或者,如果这是不可能的,我应该如何在从终端运行时指定 Root 路径和解释器版本?
Is there a way to easily extract from Pycharm the exact run command it is using when I'm running the code via run button?Alternatively, if that's impossible, how should I specify the path to Root and the interpreter version when running from terminal?
推荐答案
我想最好的方法是在终端或 pycharm 中创建一个 virtualenv,包括 corrext python 2.7 版,然后通过 pip 将pyrot安装到这个 virtualenv 中.然后你可以简单地在远程主机中 ssh,激活 venv 并从终端启动你的项目.或者您使用 X-forwarding ssh 进入它并从您的客户端启动 Pycharm 本身.
I guess to best way is to create a virtualenv either in the terminal or in pycharm including the corrext python version 2.7 and install pyroot via pip into this virtualenv. Then you can simply ssh in the remote host, activate the venv and start your project from the terminal. Or you ssh into it with X-forwarding and start Pycharm itself from your client.
这篇关于是否可以从 Pycharm 中轻松提取 python 运行配置(带有附加路径)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!