ubuntu pycharm无法输入中文 | pycharm python console 报错

pycharm 无法输入中文

ubuntu pycharm 搜狗输入法无法输入中文
网上说在python.sh加上啥啥啥 export,或者在help里面edit custom vm options加上啥啥啥,没有解决问题

换低版本的 pycharm 即可

pycharm旧版本,点击跳转
我换了2019版本,有效

pycharm python console 报错

python 3.8 用低版本的pycharm报错:

1. /opt/pycharm/helpers/pydev/_pydevd_bundle/pydevd_resolver.py:138: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if found.get(name) is not 1:


2.Error:Console process terminated with error:
(省略一万字)
File "/opt/pycharm/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)

第1个,需要把
/opt/pycharm/helpers/pydev/_pydevd_bundle/pydevd_resolver.py文件的138行的
is not换成!=。在pycharm里面不能直接编辑,权限不够
打开终端

注意:文件路径,是pycharm中报错的文件路径,比如/opt/pycharmxxxx(带版本号),复制过来

sudo vim /opt/pycharm/helpers/pydev/_pydevd_bundle/pydevd_resolver.py

:138		(冒号138,表示跳转到138行)
按 h(左)l(右)移动到 is not 的后面
i 进入插入模式,backspace 删除 is not 
输入 !=

按键盘左上角 esc 退出编辑模式
:wq 		(冒号,w表示保存,q表示退出)

第2个,用同样的方式进入文件

sudo vim /opt/pycharm/helpers/third_party/thriftpy/_shaded_thriftpy/_compat.py
把101行开始的
    if PY3:
        new_code = types.CodeType(len(varnames),
                                  0,
                                  len(varnames),
                                  code.co_stacksize,
                                  code.co_flags,
                                  code.co_code,
                                  code.co_consts,
                                  code.co_names,
                                  varnames,
                                  code.co_filename,
                                  "__init__",
                                  code.co_firstlineno,
                                  code.co_lnotab,
                                  code.co_freevars,
                                  code.co_cellvars)
    elif JYTHON:
        from org.python.core import PyBytecode

换成

    if PY3:
        args = [len(varnames),
                0,
                len(varnames),
                code.co_stacksize,
                code.co_flags,
                code.co_code,
                code.co_consts,
                code.co_names,
                varnames,
                code.co_filename,
                "__init__",
                code.co_firstlineno,
                code.co_lnotab,
                code.co_freevars,
                code.co_cellvars]
        if sys.version_info >= (3, 8, 0):
            #Python 3.8 and above supports positional-only parameters. The number of such
            #parameters is passed to the constructor as the second argument.
            args.insert(2, 0)
        new_code = types.CodeType(*args)
    elif JYTHON:
        from org.python.core import PyBytecode

重启pycharm即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

竹一笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值