Pycharm下Python Console 和Debugger Console 乱码问题

Python Console 出现乱码

在这里插入图片描述
解决方案参考:
https://blog.youkuaiyun.com/huiyanshizhu/article/details/78907629

print("中文")出现乱码,在环境变量中添加PYTHONIOENCODING=UTF-8
ls 出现乱码添加:!chcp 65001
在这里插入图片描述

Debugger Console 出现乱码

在这里插入图片描述

File Encoding 修改Project EncodingGBK即可。
在这里插入图片描述

C:\Users\52945\AppData\Local\Programs\Python\Python311\python.exe "C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pydev\pydevconsole.py" --mode=client --port=2972 ------------------------------------------------------------------------------- pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute) pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints. pydev debugger: Related bug: http://bugs.python.org/issue1666807 ------------------------------------------------------------------------------- import sys; print(&#39;Python %s on %s&#39; % (sys.version, sys.platform)) sys.path.extend([&#39;D:\\PyLib&#39;, &#39;D:/PyLib&#39;]) Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] Type &#39;copyright&#39;, &#39;credits&#39; or &#39;license&#39; for more information IPython 8.14.0 -- An enhanced Interactive Python. Type &#39;?&#39; for help. PyDev console: using IPython 8.14.0 Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32 runfile(&#39;D:/PyLib/C 参数获取/2、期货数据获取/期货数据获取测试.py&#39;, wdir=&#39;D:/PyLib/C 参数获取/2、期货数据获取&#39;) Traceback (most recent call last): File "C:\Users\52945\AppData\Local\Programs\Python\Python311\Lib\site-packages\IPython\core\interactiveshell.py", line 3508, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-76c1628e4686>", line 1, in <module> runfile(&#39;D:/PyLib/C 参数获取/2、期货数据获取/期货数据获取测试.py&#39;, wdir=&#39;D:/PyLib/C 参数获取/2、期货数据获取&#39;) File "C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+
最新发布
03-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值