Pycharm无法连接到控制台进程退出代码-1远程解释器

时间:2018-06-01 13:13:39

标签: python ubuntu pycharm

我正在尝试连接到远程python解释器,但我在Python控制台中收到以下错误:

    Is there a reason you want to navigate by url why not use the navigate method like this:

    in RouteConf: { path: '/path/:data', name: 'Defined_Path_Name', component: PathComponent }
    navigate with: this.router.navigate(['Defined_Path_Name', { data: { entity: 'entity' } } ]);

    in /path: console.log(this.routeParams.get('data'))
    that got me: Object {entity: "entity"}

//in your route file 

 in RouteConf: {path: 'calculator/:data', component: CalculatorComponent},

//in your component file navigate by like below

 navigate with: this.router.navigate(['/calculator', { data: this.loaddata } ]);

//and get data in  /calculator path like 

this.data =  this.route.snapshot.data['data'];

than console.log(this.data);

我正在使用以下内容:

Pycharm版本:Pycharm Professional 2017.3.4。

项目解释器:远程Python 3.6.5(通过OpenStack构建的远程虚拟ubuntu 16.04服务器的ssh连接)。

部署:SFTP,auth类型:带私钥文件的密钥对。

SFTP连接正常,代码与远程服务器的同步也可以正常工作。但我似乎无法在Python控制台中运行任何代码。

关于如何解决这个问题的任何想法?
在此先感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

当我尝试直接连接到端口22时,出现如下错误。

ssh://keiichi.kuroyanagi@mygcp:22/home/keiichi.kuroyanagi/.pyenv/shims/python -u /home/keiichi.kuroyanagi/.pycharm_helpers/pydev/pydevconsole.py 0 0
Couldn't connect to console process.
Process finished with exit code -1

我现在通过如下配置RoyalTSX中的端口转发来连接到远程控制台。

enter image description here

控制台如下。

ssh://keiichi.kuroyanagi@localhost:10022/home/keiichi.kuroyanagi/.pyenv/shims/python -u /home/keiichi.kuroyanagi/.pycharm_helpers/pydev/pydevconsole.py 0 0

import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/home/keiichi.kuroyanagi/tmp/pycharm_project_444', '/home/keiichi.kuroyanagi/tmp/pycharm_project_444'])

Python 3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 19:16:44) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 7.1.1

Python 3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 19:16:44) 
[GCC 7.3.0] on linux

In[2]:

以下链接也可能有帮助。

无法连接到远程解释器python控制台:PY-18029 https://youtrack.jetbrains.com/issue/PY-18029

我的pycharm版本如下。

PyCharm 2018.2.4 (Professional Edition)
Build #PY-182.4505.26, built on September 19, 2018
Licensed to DeNA Co.,Ltd. / Keiichi Kuroyanagi
You have a perpetual fallback license for this version
Subscription is active until October 24, 2019
JRE: 1.8.0_152-release-1248-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6