0
votes

I want to debug with Pycharm on windows 10. So I reference the youtube video.

How to debug Odoo using Pycharm in Window 10

https://www.youtube.com/watch?v=aCXlh4Z2mbQ

I copy the server directory form odoo 11 installed directory. And then use Pycharm to open.

I also install Package reuirements and Visual C++ 14.0(in odoo 11 vcredist directory).

I install win-psycopg for python 3.5, because it does not support Python 3.6.1.

My Pycharm configuration setting as below:

Script path = odoo-bin

Parameters = -w openpg -r openpgpwd --addons-path=addons

Working directory = D:\tmp\server

When I run the project , Pycharm displays error messages as below:

Does somebody know how to solve it?

D:\Python36\python.exe odoo-bin -w openpg -r openpgpwd --addons-path=addons

Traceback (most recent call last):

File "odoo-bin", line 5, in

import odoo 

File "D:\tmp\server\odoo__init__.py", line 84, in

from . import modules 

File "D:\tmp\server\odoo\modules__init__.py", line 8, in

from . import db, graph, loading, migration, module, registry 

File "D:\tmp\server\odoo\modules\graph.py", line 10, in

import odoo.tools as tools 

File "D:\tmp\server\odoo\tools__init__.py", line 10, in

from .convert import * 

File "D:\tmp\server\odoo\tools\convert.py", line 22, in

from .yaml_import import convert_yaml_import 

File "D:\tmp\server\odoo\tools\yaml_import.py", line 23, in

from .safe_eval import safe_eval 

File "D:\tmp\server\odoo\tools\safe_eval.py", line 21, in

from psycopg2 import OperationalError 

File "D:\Python36\lib\site-packages\psycopg2-2.6.2-py3.6-win-amd64.egg\psycopg2__init__.py", line 50, in

from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID 

ModuleNotFoundError: No module named 'psycopg2._psycopg'

Process finished with exit code 1

1

1 Answers

1
votes

The error:

ModuleNotFoundError: No module named 'psycopg2._psycopg'

it's because you lose dependencies for odoo server, in this case psycopg2 just excecute:

pip install psycopg2-binary

I hope this answer can be helpfull for you or anyone else.