bsddb.db.DBPermissionsError(不允许操作1';)-Python 2.7
我试图永久保存数据,但遇到以下错误:bsddb.db.DBPermissionsError(不允许操作1';)-Python 2.7,python,database,python-2.7,shelve,Python,Database,Python 2.7,Shelve,我试图永久保存数据,但遇到以下错误: Traceback (most recent call last): File "C:\Users\jorge\Desktop\new 1. - C¾pia.py", line 6, in <module> database = shelve.open('sub.db', 'c') File "C:\Python27\lib\shelve.py", line 239, in open return DbfilenameS
Traceback (most recent call last):
File "C:\Users\jorge\Desktop\new 1. - C¾pia.py", line 6, in <module>
database = shelve.open('sub.db', 'c')
File "C:\Python27\lib\shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "C:\Python27\lib\shelve.py", line 223, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "C:\Python27\lib\anydbm.py", line 85, in open
return mod.open(file, flag, mode)
File "C:\Python27\lib\dbhash.py", line 18, in open
return bsddb.hashopen(file, flag, mode)
File "C:\Python27\lib\bsddb\__init__.py", line 364, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb.db.DBPermissionsError: (1, 'Operation not permitted')
我已经在网上搜索了答案,但没有找到任何帮助
提前感谢,
若昂·皮哈尔
编辑:
这是目录中的权限。
我无法在桌面上创建该文件。您没有编辑该文件的权限,或者您没有在当前目录中创建新文件的权限。
sub.db
是否已经存在,或者您正在尝试创建它?是的,我认为是目录中的权限。非常感谢。
import shelve
database = shelve.open('sub.db', 'c')
database.close()