Error: cannot import name 'clear_cache')

Get this error when installing erpnext:

Module import failed for Period Closing Voucher (erpnext.accounts.doctype.period_closing_voucher.period_closing_voucher Error: cannot import name ‘clear_cache’)

Bench running on production mode with frappe 13.9.2. I’ve tried different versions of frappe and erpnext only to get the same result. Tried bench update and whatnot. Ive tried installing erpnext on 3 different live servers. Any ideas?