Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError when running on Odoo.sh #3

Closed
zachwaite opened this issue May 5, 2023 · 1 comment · Fixed by #8
Closed

ModuleNotFoundError when running on Odoo.sh #3

zachwaite opened this issue May 5, 2023 · 1 comment · Fixed by #8

Comments

@zachwaite
Copy link
Contributor

I've added OCA/rest-framework as a submodule in our Odoo.sh environment and am using base_rest_pydantic successfully, but this traceback keeps showing up in the logs when starting a python interpreter or upgrading a module from the CLI. It appears to be coming from the fact that python hasn't fully loaded all the search paths at this point in the startup when the .pth is executed.

Error processing line 1 of /home/odoo/.local/lib/python3.8/site-packages/extendable_pydantic_patcher.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "/home/odoo/.local/lib/python3.8/site-packages/extendable_pydantic/_patch.py", line 2, in <module>
      import wrapt
  ModuleNotFoundError: No module named 'wrapt'

Remainder of file ignored
Error processing line 1 of /home/odoo/.local/lib/python3.8/site-packages/extendable_pydantic_patcher.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "/home/odoo/.local/lib/python3.8/site-packages/extendable_pydantic/_patch.py", line 2, in <module>
      import wrapt
  ModuleNotFoundError: No module named 'wrapt'

I edited _patch.py to add a call to site.main() before import wrap and it solves the error. Can provide a PR if useful.

Thanks for your work on all this.

@damdam-s
Copy link

damdam-s commented Jun 6, 2023

Can you please provide a PR for this fix?
It will be useful while a fix from maintainer is elaborated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants