跳至内容
菜单
此问题已终结
1 回复
6447 查看

my env: Ubuntu 22.04 LTS, Odoo 16.0, Pycharm CE 2023.1

please help i am facing problem below, here is what i have done yet in Terminal.

cd odoo-server

/home/odoo16/odoo-server/odoo-bin -c /home/odoo16/odoo-server/odoo.conf -d odoo16 -u mytest

Traceback (most recent call last):
File "/home/odoo16/odoo-server/odoo-bin", line 5, in
import odoo
File "/home/odoo16/odoo-server/odoo/__init__\\\.py",\\\ line\\\ 113,\\\ in\\\
\\\ \\\ \\\ \\\ from\\\ \\\.\\\ import\\\ modules
\\\ \\\ File\\\ "/home/odoo16/odoo\\\-server/odoo/modules/__init__\\\.py",\\\ line\\\ 8,\\\ in\\\
\\\ \\\ \\\ \\\ from\\\ \\\.\\\ import\\\ db,\\\ graph,\\\ loading,\\\ migration,\\\ module,\\\ registry,\\\ neutralize
\\\ \\\ File\\\ "/home/odoo16/odoo\\\-server/odoo/modules/db.py", line 4, in
from psycopg2.extras import Json
ModuleNotFoundError: No module named 'psycopg2'

python3 -m venv venv
source venv/bin/activate
pip install psycopg2-binary

try starting again, but same error.

note: through pycharm it started server and i can access / run all apps including my custom test app.

regards

形象
丢弃
最佳答案

Hi,

When you are running from the terminal system may be using the default python version of the system and in the pycharm you may be running odoo with a separate python(may be a virtual env), so if you need to run from the terminal, you can select the same python version you have used in pycharm.


when you run odoo using the pycharm, see the first line in the pycharm log, you will get the command to run from the terminal.

Sample:

/home/dev/odoo/15.0/venv/bin/python /home/dev/odoo/15/odoo/odoo-bin -c /home/dev/odoo/15/conf/odoo.conf

Thanks

形象
丢弃
编写者

thanks @Niyas Raphy again for help. its working fine now
the line below copied from pycharm as instructed and stopped here, open terrminal and pasted it on command line, hit enter... and its running successfully now.

/home/odoo16/odoo-server/venv/bin/python /home/odoo16/odoo-server/odoo-bin -c odoo.conf

regards

相关帖文 回复 查看 活动
3
8月 25
2316
1
5月 25
2544
1
4月 25
3515
1
4月 25
4344
1
4月 25
1820