Skip to Content
Menu
This question has been flagged
2 Replies
11701 Views

Hi,

I get "No module named 'PyPDF2'" error and then suddenly Odoo12 service stops.

If I try to install PyPDF2 library I get this message: sudo /opt/odoo12/venv/bin/python3 -m pip install PyPDF2

Requirement already satisfied: PyPDF2 in /opt/odoo12/venv/lib/python3.6/site-packages (1.26.0)

If I execute this command, I can see PyPDF2 module installed: /opt/odoo12/venv/bin/python3 -m pip list

Package Version 
--------------- --------- 
PyPDF2 1.26.0

My system versions:

Odoo version: 12

Python version: 3.6.3

CentOS Linux release 7.6.1810

Any help please?

Thanks!


Avatar
Discard
Author Best Answer

Hi Niyas,

Odoo is using Python 3.6. Here launch process:

[root@server venv]# sudo systemctl status odoo12*
odoo12.service - Odoo12
Loaded: loaded (/etc/systemd/system/odoo12.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-06-26 16:15:01 CEST; 1min 23s ago
Main PID: 7683 (scl)
CGroup: /system.slice/odoo12.service
|-7683 /usr/bin/scl enable rh-python36 -- /opt/odoo12/venv/bin/python3 /opt/odoo12/odoo/odoo-bin -c /etc/odoo12.conf
|-7694 /bin/bash /var/tmp/scljt1CKJ
`-7704 /opt/odoo12/venv/bin/python3 /opt/odoo12/odoo/odoo-bin -c /etc/odoo12.conf​

I verify that PyPDF2 package is in this folder: /opt/odoo12/venv/lib/python3.6/site-packages

drwxrwxr-x 3 odoo12 odoo12 4096 Mar 26 15:03 PyPDF2
drwxrwxr-x 2 odoo12 odoo12 4096 Mar 26 15:03 PyPDF2-1.26.0-py3.6.egg-info​


File permission are correct too...

Until tomorrow, Odoo worked very well, but suddenly, since yesterday, service get down very frecuently. And we did not do any change or module install last weeks.

Thanks!

Avatar
Discard
Author

Hi,

I can't solve this problem...

I tried commenting this line:

#from . import pdf

from "/opt/odoo12/odoo/odoo/tools/__init__.py" file.

But now, I have another error:

File "/opt/odoo12/odoo/odoo/tools/config.py", line 18, in <module>

odoo12[14510]: from passlib.context import CryptContext

odoo12[14510]: ModuleNotFoundError: No module named 'passlib'

systemd[1]: odoo12.service: main process exited, code=exited, status=1/FAILURE

systemd[1]: Unit odoo12.service entered failed state.

systemd[1]: odoo12.service failed.

I am so lost...

Author

SOLVED!!!!!

I have solved the problem installing all dependencies this way:

/opt/rh/rh-python36/root/usr/bin/pip3.6 install PyPDF2

Best Answer

Hi,

Make sure that Odoo is running using the same python interpreter in which the package is installed in. Also after installing the package did you restart the odoo service? If not restart the service.


Thanks

Avatar
Discard
Related Posts Replies Views Activity
3
Sep 21
10606
2
Nov 18
3476
0
Apr 24
455
2
Jan 21
4116
2
Apr 20
70286