PDF - ImportError: cannot import name OpenIDConnectAuthCode

Hi,
I did a db restoration from sql file. After that I been having issue with PDF print with Images. The system freezes for a while without result

The frappe.log shows the following. Any suggestions ? or clues to what i might need to do. Thank you!

Form Dict: {
 "_lang": "en", 
 "data": "", 
 "doctype": "Sales Invoice", 
 "format": "Outpatient Invoice", 
 "name": "PSINV-02438", 
 "no_letterhead": "0"
}
Request Error
Traceback (most recent call last):
  File "/home/frappe/frappebench/apps/frappe/frappe/app.py", line 67, in application
    response = frappe.api.handle()
  File "/home/frappe/frappebench/apps/frappe/frappe/api.py", line 37, in handle
    validate_oauth()
  File "/home/frappe/frappebench/apps/frappe/frappe/api.py", line 131, in validate_oauth
    from frappe.oauth import get_url_delimiter
  File "/home/frappe/frappebench/apps/frappe/frappe/oauth.py", line 7, in <module>
    from oauthlib.oauth2.rfc6749.grant_types import AuthorizationCodeGrant, ImplicitGrant, ResourceOwnerPasswordCredentialsGrant, ClientCredentialsGrant,  RefreshTokenGrant, OpenIDConnectAuthCode
ImportError: cannot import name OpenIDConnectAuthCode
[ERROR] 2019-04-06 05:48:12,312 | /home/frappe/frappebench/apps/frappe/frappe/utils/error.py:
New Exception collected with id: 2019-04-06 05:48:12.085006-5.32.54.77-606
[ERROR] 2019-04-06 05:48:40,283 | /home/frappe/frappebench/apps/frappe/frappe/app.py:

How was the backup made and restored?
Was the backup from the same ERPNExt instance as the one restored to?
Was the user performing the backup and restoration the same user?

@smino
Sql from erpnext cloud to on premise server. Built a version 10 instance and migrated. had couple of hick ups but i managed to get it all in including the files.

Did you make the backup from the ERPNext Download Backups , then transfer the files from sites//private/backups , then in new instance: bench --site --force restore /path/to/database.sql.gz ?

May be necessary to change site//site_config.json , compare with one on cloud.