1
locoz 2022-12-13 03:49:51 +08:00
我的评价是:建议拿着报错内容去咨询 ChatGPT
|
3
Xs0ul 2022-12-13 04:00:12 +08:00
建议贴上完整的 stack trace 和报错信息。光看你这个报错,看起来像是重复执行某些代码,但没有权限覆盖旧的文件
|
4
y4nssss OP D:\tools\anaconda3\envs\pythonProject22\python.exe E:\workspace\pythonProject22\main.py
destination: ./VisBeatAssets/VideoSources\ name: video source_location: ./data/01.mp4 Video source at ./VisBeatAssets/VideoSources\video\ Calculating frames for 01_Full... Done. Traceback (most recent call last): File "E:\workspace\pythonProject22\main.py", line 10, in <module> source_video = vb.PullVideo(name='video', source_location='./data/01.mp4') File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\__init__.py", line 59, in PullVideo vs = VideoSource.NewVideoSource(destination=GetVideoSourcesDir(), name=vname, source_location=source_location, max_height=max_height, **kwargs); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 56, in NewVideoSource return VideoSource(path=vsdir, name=name, source_location=source_location, **kwargs); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 45, in __init__ self.setSource(source_location=source_location, assert_valid=None, **kwargs); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 499, in setSource self.setSourceFile(path = source_location, **kwargs); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 549, in setSourceFile self.addVersion(path=output_path, version_label='Full'); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 477, in addVersion self.save(); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 219, in save self.hardSave(); File "D:\tools\anaconda3\envs\pythonProject22\lib\site-packages\visbeat3\VideoSource.py", line 213, in hardSave os.rename(self.getJSONPath(), self.getDir('backup') + os.sep + self.AOBJECT_TYPE() + ".json"); FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: './VisBeatAssets/VideoSources\\video\\VideoSource.json' -> './VisBeatAssets/VideoSources\\video\\Data\\Backups\\\\VideoSource.json' 进程已结束,退出代码 1 |
5
y4nssss OP 调试:
os.rename(self.getJSONPath(), self.getDir('backup') + os.sep + self.AOBJECT_TYPE() + ".json"); |
6
y4nssss OP windows 下不行 ubuntu 可以 why??
|
7
Xs0ul 2022-12-13 04:21:30 +08:00
https://docs.python.org/3/library/os.html
On Windows, if dst exists a FileExistsError is always raised. On Unix, ... If both are files, dst will be replaced silently if the user has permission. |