Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
18870 Lượt xem

Hi there,

I am trying to install Odoo 9 by sources on Ubuntu 16.04.5 LTS but unfortunately when executing ./odoo-bin I receive following issue:

Traceback (most recent call last):

  File "./odoo-bin", line 5, in <module>

    import odoo

  File "/media/sf_git/source/odoo/odoo/__init__.py", line 89, in <module>

    from . import modules

  File "/media/sf_git/source/odoo/odoo/modules/__init__.py", line 8, in <module>

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

  File "/media/sf_git/source/odoo/odoo/modules/graph.py", line 10, in <module>

    import odoo.tools as tools

  File "/media/sf_git/source/odoo/odoo/tools/__init__.py", line 7, in <module>

    from . import pdf

  File "/media/sf_git/source/odoo/odoo/tools/pdf.py", line 4, in <module>

    from PyPDF2 import PdfFileWriter, PdfFileReader

ImportError: No module named 'PyPDF2'


I tried to sudo pip install PyPDF and sudo pip install PyPDF2

But always receive following message:

Reqirement already satisfied (use --upgrade to upgrade): PyPDF in /usr/local/lib/python2.7/dist-packages

You are using pip version 8.1.1, however version 18.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.


I am not 100% if everything is set up correctly regarding Python versions. I read that I do require pyhthon 2.7.9 for Odoo 9 and I did install it. But not 100% sure if it is set as default or if I need to configure this some how.

Running python -V returns: Python 2.7.9

Running python3 -V return: Python 3.5.2


Hope you can help me! Thanks in advance!

Ảnh đại diện
Huỷ bỏ

can you setup virtualenv with python2 and

pip install --no-cache -r requiments.txt then try it. here is guide for venv https://virtualenv.pypa.io/en/latest/userguide/

Tác giả Câu trả lời hay nhất

I noticed that I was running on Odoo 11.0 sources. After switichting the branch to Odoo 9.0 it worked just fine!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

The problem is a session that is terminated and ODOO restart but not in VENV context so python3 doesnt find correct dependencies

See the correct mode to launch if venv is used:
https://github.com/odoo/odoo/issues/33479#issuecomment-1207347677

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

hello,

install this below package

sudo apt-get install python-pypdf2

or 

sudo python -m pip install pypdf2


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 4 21
8425
6
thg 6 16
6067
0
thg 2 16
3001
3
thg 1 16
3789
3
thg 6 25
2385