Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
pycharm未使用python3.8连接到控制台_Python_Console_Pycharm_Python 3.8 - Fatal编程技术网

pycharm未使用python3.8连接到控制台

pycharm未使用python3.8连接到控制台,python,console,pycharm,python-3.8,Python,Console,Pycharm,Python 3.8,我不知道为什么;但是自从python 3.8发布以来;我无法运行pycharm控制台,它始终处于“正在连接”状态 我对python 3.7没有任何问题;因为控制台会立即打开。 在这里你可以看到,我已经试过几次运行控制台,但我知道,即使我等了一天;它没有连接到控制台;但是,当我将解释器从python3.8更改为python3.7时,我打开的新控制台都会在一秒钟内设置好 错误: C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_py

我不知道为什么;但是自从python 3.8发布以来;我无法运行pycharm控制台,它始终处于“正在连接”状态

我对python 3.7没有任何问题;因为控制台会立即打开。

在这里你可以看到,我已经试过几次运行控制台,但我知道,即使我等了一天;它没有连接到控制台;但是,当我将解释器从python3.8更改为python3.7时,我打开的新控制台都会在一秒钟内设置好

错误:

C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydevd_bundle\pydevd_resolver.py:138: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if found.get(name) is not 1:
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevconsole.py", line 33, in <module>
    from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_console_utils.py", line 11, in <module>
    from _pydevd_bundle import pydevd_thrift
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydevd_bundle\pydevd_thrift.py", line 17, in <module>
    from pydev_console.protocol import DebugValue, GetArrayResponse, ArrayData, ArrayHeaders, ColHeader, RowHeader, \
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydev_console\protocol.py", line 6, in <module>
    _console_thrift = _shaded_thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "console.thrift"),
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\parser\__init__.py", line 29, in load
    thrift = parse(path, module_name, include_dirs=include_dirs,
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 502, in parse
    parser.parse(data)
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_ply\yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_ply\yacc.py", line 1106, in parseopt_notrack
    p.callable(pslice)
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 212, in p_struct
    val = _fill_in_struct(p[1], p[3])
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\parser\parser.py", line 765, in _fill_in_struct
    gen_init(cls, thrift_spec, default_spec)
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 103, in gen_init
    cls.__init__ = init_func_generator(default_spec)
  File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third_party\thriftpy\_shaded_thriftpy\_compat.py", line 102, in init_func_generator
    new_code = types.CodeType(len(varnames),
TypeError: an integer is required (got type bytes)

C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\\u pydevd\u bundle\pydevd\u resolver.py:138:SyntaxWarning:带文字的“不是”。你是说“!=”吗?
如果找到。get(name)不是1:
回溯(最近一次呼叫最后一次):
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevconsole.py”,第33行,在
从_pydev_bundle.pydev_控制台_utils导入BaseExplorerInterface
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\\u pydev\u bundle\pydev\u console\u utils.py”,第11行,在
从pydevd_bundle导入pydevd_thrift
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\\u pydevd\u bundle\pydevd\u thrift.py”,第17行,在
从pydev_console.protocol导入DebugValue、GetArrayResponse、ArrayData、ArrayHeaders、ColHeader、RowHeader、\
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydev_console\protocol.py”,第6行,在
_console_thrift=_shaded_thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(u文件_u)),“console.thrift”),
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\parser\\uuuuuuu init\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
thrift=parse(路径、模块名称、include\u dirs=include\u dirs、,
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\parser\parser.py”,第502行,在parse中
parser.parse(数据)
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\u shaded\u ply\yacc.py”,第331行,解析
返回self.parseopt_notrack(输入、lexer、调试、跟踪、tokenfunc)
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\u shaded\u ply\yacc.py”,第1106行,位于parseopt\u notrack中
p、 可调用(pslice)
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\parser\parser.py”,第212行,在p_结构中
val=_fill_in_struct(p[1],p[3])
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\parser\parser.py”,第765行,在结构中填充
gen_init(cls、节俭规范、默认规范)
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\thrift.py”,第103行,初始版本
cls.\uuuuu init\uuuuu=init\u func\u生成器(默认规格)
文件“C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\third\u party\thriftpy\\u shaded\u thriftpy\\u compat.py”,第102行,在初始函数生成器中
新代码=类型。代码类型(len(varnames),
TypeError:需要整数(获取类型字节)
照片:

pycharm规范:pycharm专业版2019.1.3它在pycharm(社区)2019.3上运行良好

PyCharm提供(对于当前版本,它是一个经过修改的v0.3.8),因为它需要它来实现不同的功能(包括Python控制台)

Python3.8附带了一组更改(一个示例是),需要对许多现有(第三方)包进行更改以使其正常工作(对于其中一些包,仍然存在WiP)

显然,ThriftPy是需要更改的软件包之一。但是,自2016年以来,它一直没有得到维护,因此JetBrains在其存储库中保留了(副本/分叉?)

无论如何,您面临的问题已由解决。
不幸的是,我在上找不到该问题,因此我没有关于该问题的任何其他信息(如修复时间等)

我能告诉你的是(也在开头提到过),它在PyCharm(Community)2019.3中被修复(有效),因此如果你升级它,你就不会再有这个问题了


一种解决方法(如果不选择升级)是将修补程序(在提交URL中)应用于您的(本地)_compat.py文件。请检查(修补utrunner部分)以了解如何应用修补程序(在Win上).
小贴士:对本地文件应用反向补丁,使问题变得明显。

您配置了解释器吗?还有,哪个python(如果您同时安装了这两个)在你的路径中吗?@Swedgin;是的,配置和路径都正确地分配给了pycharm。@Swedgin,你猜错了吗?对不起,帮不了你。我已经很久没有使用pycharm了。这是我能想到的唯一两个问题。太好了,谢谢!事实上,我以为pycharm已经成功了y修复了这个问题,所以我在设置赏金之前更新了Pycharm,但它并没有解决问题。显然,更新是从1.3到1.4,尽管版本3已经可用。更新再次解决了问题,正如你所说。@EllaSharakanski,感谢赏金,也感谢
@CristiFati
的响应。我还有这个常量ant issue
连接到console
,我无法使用答案的解决方案,因为我需要运行PyCharm 2018.3,因为这是支持32位的最新版本。我使用的是普通Python解释器。我可以使用菜单中的“run”来运行Python脚本,但如果我右键单击所选行并选择“在console中执行选择”(或Alt+Shift+E),没有执行。我在@Lorenz上添加了一条注释以解决PyCharm 2018.3的问题:您可以将更改应用到本地安装,正如我在回答末尾所指示的。我在“C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.7\helpers\third\U party\thriftpy\U shaded\U thriftpy\”中发现了_combat.py.我把它复制到了“C:\tmp\”,然后