2

I tried to use odoo 13 and i worked with python 3.8 , but this error python always appears

ImportError: cannot import name '_has_surrogates' from partially initialized module 'email.utils' (most likely due to a circular import) (C:\Python38\lib\email\utils.py)

thank you

Fares Izem
  • 177
  • 2
  • 2
  • 9

2 Answers2

2

Probably you're using a file name which is creating a circular dependency with the one being used in 'email.utils'.

Rename your file name.

It shouldn't be too generic like email.py, calendar.py, etc.

e.g. if you're using email.py as your working python file, rename it to project_mailer.py or whatever suits better. As long as your selected name is not creating any circular dependency, you're good to go.

kartoon
  • 1,040
  • 1
  • 11
  • 24
1

Please provide the entire log or a better explanation of the problem circular import is just one of the possible cases.

One solution is to update email package to the newest version

If you problem is with ODOO and pycharm you probably have to uncheck add content roots to PYTHONPATH and add source roots to PYTHONPATH on run configurations.

buhtz
  • 10,774
  • 18
  • 76
  • 149