我在使用IronPython中转储的Python加载pickle时遇到了困难.
当我在IronPython中挑选像"[1,2,3]"这样的基本内容时,pickle在Python中加载得很好.但是,当我在IronPython中从下面的数据库查询中挑选结果时,在尝试加载Python中的pickle时,我收到错误"没有名为clr的模块".
可能出了什么问题?(有没有更好的方法在Python和IronPython之间共享数据?)
def GetData(id):
TheConnection = SqlClient.SqlConnection("server=MyServer;database=MyDB;Trusted_Connection=yes")
TheConnection.Open()
sqlcommand = "MyStoredProcedure#GetMyData '%s'" %id
MyAction = SqlClient.SqlCommand(sqlcommand, TheConnection)
MyReader = MyAction.ExecuteReader()
results = list()
while MyReader.Read():
row = {
'Type':'LolCat',
'Date':datetime.datetime(MyReader[1]),
'Location':str(MyReader[3]),
'Weight':float(MyReader[6])/float(MyReader[7]),
}
results.append(row)
TheConnection.Close()
MyReader.Close()
return results
results1 = GetData(1234)
results2 = GetData(2345)
...
picklefile= open("testpickle","w")
cPickle.dump((results1,results2),picklefile)
...
picklefile = open("testpickle","r")
p = cPickle.load(file) # this is the line that gives the error "ImportError: No module named clr"
Run Code Online (Sandbox Code Playgroud) 我正在尝试通过调用以下命令使用Firebase CLI 导出Firebase用户帐户:
firebase auth:export save_file.json --format=json --project=MyProjectName
这将返回以下错误消息:
Error: Authorization failed. This account is missing the following required permissions on project MyProject:
firebase.projects.get
firebaseauth.users.get
Run Code Online (Sandbox Code Playgroud)
我的帐户具有所有者级别的权限,根据GCloud IAM设置页面,该权限具有“对所有资源的完全访问权限”。
所有者帐户怎么会缺少必需的权限?我如何克服此错误来执行导出?
我已确认我已登录CLI的正确帐户。当我执行firebase login它时,返回的Already logged in as ****@gmail.com是与我拥有所有者级别权限的帐户相同的帐户(以及创建项目的帐户)。