pydev 调试器在启动时失败,但代码运行良好 [英] pydev debugger fails on launch but code runs fine

查看:212
本文介绍了pydev 调试器在启动时失败,但代码运行良好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 LiClipse(两者的最新版本)启动 pydev 调试器时,出现KeyError:"异常.

When I launch the pydev debugger with LiClipse (latest versions of both) I get a "KeyError:" exception.

我已确保工作区文件夹具有适当的权限.即使我在管理员模式下运行 LiClipse,我也会遇到这个问题.

I have ensured that the workspace folder has the proper permissions. I get this problem even if I run LiClipse in Administrator mode.

我希望能够调试我的 Python 代码.我的实际结果是以下错误:

I expect to be able to debug my python code. My actual results are the following errors:

pydev debugger: starting (pid: 15388)
Traceback (most recent call last):
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 487, in _original_file_to_client
    return cache[filename]
KeyError: 'c:\\users\\xyz\\my documents\\liclipse workspace\\xyzjirabot\\xyzjirabot.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\_pydevd_bundle\pydevd_net_command_factory_xml.py", line 197, in make_thread_stack_str
    py_db, curr_frame, frame_id_to_lineno
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\_pydevd_bundle\pydevd_net_command_factory_xml.py", line 170, in _iter_visible_frames_info
    filename_in_utf8 = pydevd_file_utils.norm_file_to_client(abs_path_real_path_and_base[0])
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 489, in _original_file_to_client
    translated = _path_to_expected_str(get_path_with_real_case(_AbsFile(filename)))
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 196, in _get_path_with_real_case
    return _resolve_listing(drive, iter(parts))
  File "C:\Program Files\Brainwy\LiClipse 5.2.4\plugins\org.python.pydev.core_7.2.1.201904261609\pysrc\pydevd_file_utils.py", line 159, in _resolve_listing
    dir_contents = cache[resolved_lower] = os.listdir(resolved)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\xyz\\My Documents'

推荐答案

当我发布这个问题时,我注意到用作键的文件名和实际文件路径存在大小写差异.我将工作区移至 C 驱动器的根目录,这似乎解决了问题.

While I was posting this question I noticed that there is a capitalization difference with the file name being used as the key and the actual file path. I moved the workspace to the root of my C Drive and that seems to have fixed the problem.

这篇关于pydev 调试器在启动时失败,但代码运行良好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆