在使用pyinstaller形成可执行文件后,出现了一个问题。 这段代码使用函数win32api.GetShortPathName检查文件是否存在于文件名较长的路径上,单独运行python文件没有问题。使用pyinstaller后,程序在相同情况下失败
Traceback (most recent call last):
File "pycopy.py", line 32, in cp
pywintypes.error: (3, 'GetShortPathNameW', 'Das System kann den angegebenen Pfad nicht finden.')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files\python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "c:\program files\python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "pycopy.py", line 131, in download
File "pycopy.py", line 83, in copyit
File "pycopy.py", line 36, in cp
pywintypes.error: (3, 'GetShortPathNameW', 'Das System kann den angegebenen Pfad nicht finden.')
错误的英文意思是:系统找不到路径
您需要Enable Long Paths in Windows 10, Version 1607, and Later,将
longPathAware
元素添加到应用程序清单中:或者添加“
\\?\
”前缀以指定winapi的Unicode版本中的扩展长度路径,例如“\\?\D:\very long path
”相关问题 更多 >
编程相关推荐