pycharm远程调试, 连接上代码无法补全问题

pycharm远程调试, 连接上代码无法补全问题


具体报错如下

Couldn't refresh skeletons for remote interpreter
			failed to run generator3/__main__.py for sftp://[email protected]:22/usr/local/bin/python3, exit code 1, stderr: 
			-----
			Traceback (most recent call last):
			File "/root/.pycharm_helpers/generator3/__main__.py", line 167, in 
			main()
			File "/root/.pycharm_helpers/generator3/__main__.py", line 114, in main
			state_json = json.loads(sys.stdin.readline(), encoding='utf-8')
			File "/usr/local/lib/python3.9/json/__init__.py", line 359, in loads
			return cls(**kw).decode(s)
			TypeError: __init__() got an unexpected keyword argument 'encoding'
			-----

解决办法

  1. 在远程主机上删掉用户目录中的**~/.pycharm_helpers**目录(在pycharm上设置的远程账号用户和执行bash命令的用户要一致)
rm -rf ~/.pycharm_helpers
  1. 在pycharm上把原来的Interpreter全部删掉, 重新配置一遍Interpreter解释器apply应用确定即可
    pycharm远程调试, 连接上代码无法补全问题_第1张图片
  2. 看到远程库文件加载成功了, 就说明可以了!

你可能感兴趣的:(日常小坑,pycharm,python,ide)