我正在尝试运行以下脚本:json.py
在本地的matplotlib副本上。但我一直收到这条我不明白的错误信息。我尝试在管理员模式下在命令提示符下运行它,但仍然得到错误。
Traceback (most recent call last):
File "C:/Users/daman/Desktop/hermes-master/src/utils/code_etl /repo_to_json.py", line 211, in <module>
repo_name
File "C:/Users/daman/Desktop/hermes-master/src/utils/code_etl/repo_to_json.py", line 130, in process_local_repo
output_file = output_dir + "/" + repo_name.replace('/', '_') + ".json"
TypeError: a bytes-like object is required, not 'str'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/daman/Desktop/hermes-master/src/utils/code_etl/repo_to_json.py", line 211, in <module>
repo_name
File "C:\Users\daman\Desktop\hermes-master\src\utils\code_etl\git_manager.py", line 66, in __exit__
shutil.rmtree(self.__tempdir)
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 507, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 386, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 386, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 386, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 391, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\daman\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 389, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\daman\\AppData\\Local\\Temp\\tmpe6tqnsio\\matplotlib\\.git\\objects\\pack\\pack-e0ef0cedb6b5eee531ff1c53aea599034caa1649.idx'发布于 2018-10-07 01:53:13
清理临时存储库的失败可能是由于代码的其他部分仍在打开Git对象文件(在Windows上,这可以防止删除)。但重要的一点是,这段代码是为Python 2编写的,与您正在使用的3不兼容。(其他部分使用print语句,甚至不编译。)
https://stackoverflow.com/questions/52683656
复制相似问题