Bench Console Error: required "type_ignores"

I’m using Ubuntu 20. Version details as below:
ERPNext: v12.10.1 (version-12)
Frappe Framework: v12.8.4 (version-12)

I always get this error whenever i use bench console:
TypeError Traceback (most recent call last)
/usr/lib/python3.8/ in call(self, source, filename, symbol)
135 def call(self, source, filename, symbol):
→ 136 codeob = compile(source, filename, symbol, self.flags, 1)
137 for feature in _features:
138 if codeob.co_flags & feature.compiler_flag:

TypeError: required field “type_ignores” missing from Module

What I already tried:

  • switched python version via pyenv global from 3.8.2 to 3.6.5 & also switched it back, but it’s still exist.
  • apt update, bench update, still not working

I installed this using easy install script.

Any help would be appreciated

Thanks in advance

1 Like

Try: bench setup requirements and bench migrate-env python3.x to whichever python 3 .

At 1st attempt it doesn’t works as expected, even my env folder gone into archived_envs folder, i don’t know why…
But after some experiments, i found out that i have to put the full python path (the one provided by pyenv) after command migrate-env (not only “python3.x”)

So, for my case, i make it like this (because i’m using pyenv):

bench migrate-env /home/{{your device username}}/.pyenv/shims/python3

and it works…
Thanks a lot @smino, your clue really appreciated =)

I have the same configuration and same problem. But the solution worked for you isn’t working for me. The command migrate-env is throwing an error before exiting… attaching the screenshot below:

I’ll try upgrading the bench… not sure exactly how though!

Try bench update --bench

It says “No such option --bench”.

What does bench --version return?

Also try bench update --reset

bench --version returns 5.2.1. I was using python3.8, downgrading it to 3.6 helped me.

1 Like

Try this.

Sorry, I forgot to mention python downgrading.
So how i solved my case:
I downgrade my python version to 3.6.5 (similiar to @DeeMysterio ) 1st using pyenv and then use the command:
bench migrate-env /home/{{your device username}}/.pyenv/shims/python3

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.