1

当我使用 LiClipse(两者的最新版本)启动 pydev 调试器时,我得到一个“KeyError:”异常。

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

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

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'
4

3 回答 3

1

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

于 2019-05-23T18:51:55.853 回答
0

我认为这是文件名中的空格。我将它移到 \Users\kieveli\Source\LiClipseWorkspace\ 并且一切正常。

于 2019-12-05T18:10:05.797 回答
0

Had the same issue - Path was set to "..\My Documents" instead of just "..\Documents". Changing the workspace to another directory fixed the problem

于 2020-08-30T08:21:51.177 回答