1

I have set up the version 11 of odoo and when I started my server it's getting errors like:

ImportError: No module named 'PyPDF2'

For that I have already installed the packages but it still generates the error. And I'm working on python-2.7.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Dipen Shah
  • 2,396
  • 2
  • 9
  • 21
  • how did you install odoo from github?? – Charif DZ Oct 07 '17 at 07:16
  • In github there is odoo-11 so i just clone the module in my system. – Dipen Shah Oct 07 '17 at 07:34
  • odoo-11 is configured for python 3.5 So may be due to python version confliction your server is not running. – Keval Mehta Oct 07 '17 at 07:37
  • As you must have already noticed that Ubuntu 16.04 has 'python 2.7.12' by default.So when in stalling the python 3 so there should be conflict of python packages.so what to do? – Dipen Shah Oct 07 '17 at 08:50
  • Remove 2.7 packages and install manually 3.5 packages – Keval Mehta Oct 07 '17 at 09:07
  • Actually when python 2.7 is remove may be it's craash your system terminal.... so my question is is it safe to do it..? means remove 2.7 and install 3.5? – Dipen Shah Oct 07 '17 at 09:10
  • By means of remove not totally remove.. Upgrade your packages to 2.7 to 3.5 – Keval Mehta Oct 07 '17 at 09:17
  • For updation this links are may be helpful to you: https://stackoverflow.com/questions/41839344/update-python-on-linux-2-7-to-3-5 https://superuser.com/questions/241865/updating-python-on-ubuntu-system – Keval Mehta Oct 07 '17 at 09:20
  • when updating 2.7 to 3.5 it's crash the packages which already in system. so is their any other option where i can simply start my v11 server.?? – Dipen Shah Oct 07 '17 at 12:06
  • can anyone tell me hot to resolve the [ ImportError: No module named 'models' ] -ERROR in version 11 of odoo...???? – Dipen Shah Oct 10 '17 at 09:12

5 Answers5

2

If someone has this error:

ImportError: No module named 'PyPDF2'

I have got this error and I have found this solution. There is no need to do extra. You just have to write this command for whatever error generate to set a version 11 environment.

Try this command:

sudo apt-get install python3-pypdf2.
vvvvv
  • 25,404
  • 19
  • 49
  • 81
Dipen Shah
  • 2,396
  • 2
  • 9
  • 21
1

If you are using Windows

run --> cmd --> pip install PyPDF2

If you are using Ubuntu server

Terminal --> sudo apt-get install PyPDF2

Otherwise manually download the package from the given link and install it. https://pypi.python.org/pypi/PyPDF2/1.25

after installing restart your Odoo application. Hope it works

sfx
  • 1,793
  • 17
  • 24
  • Yes i'm working with Ubuntu version-16.04 . and yes i'ev already installing the PyPDF2 packages for Python Lib but it didn't worked for me. – Dipen Shah Oct 07 '17 at 06:20
  • please check whether the package is installed properly – sfx Oct 07 '17 at 06:22
  • okie for your call i'ev checked again. && these show me like - Installed /usr/local/lib/python2.7/dist-packages/PyPDF2-1.26.0-py2.7.egg Processing dependencies for PyPDF2==1.26.0 Finished processing dependencies for PyPDF2==1.26.0 – Dipen Shah Oct 07 '17 at 06:26
  • Error-Traceback (most recent call last): File "/home/dipen/v11/odoo/odoo/tools/pdf.py", line 4, in from PyPDF2 import PdfFileWriter, PdfFileReader ImportError: No module named 'PyPDF2' – Dipen Shah Oct 07 '17 at 06:33
  • pip install pdfmerge ? – sfx Oct 07 '17 at 06:49
  • One more thing to ask if i downlaod this package - https://pypi.python.org/pypi/PyPDF2/1.25 so when it's downlaod so what's the next process? either i ahve to replace the packages or smthng wt?? – Dipen Shah Oct 07 '17 at 06:53
0

Just download 3.5 packages no need to remove 2.7 packages and after that migrate your custom py files in 3.5 version. So that that all are compatible with 3.5 packages. After that configure your interpreter to 3.5 and run odoo-bin file. I follow this path and currently working in v11 with python 3.5

Keval Mehta
  • 689
  • 3
  • 28
0

First install python version > 3.5

Next use pip to reinstall all the requirements for Odoo-11. Use the command:

python3.5 -m pip install -r requirements.txt

I am using python3.5 for the example.

Then re-run the odoo server using

python3.5 odoo-bin --addons=addons/
vvvvv
  • 25,404
  • 19
  • 49
  • 81
Sudhanshu Gupta
  • 331
  • 1
  • 6
  • check the path where you are executing the command. Make sure it is where we can find requirements.txt file. If not you can provide an absolute path to the file. – Sudhanshu Gupta Jun 18 '20 at 07:25
0

I made the foolish mistake of not setting correct python environment on my pycharm project: was using globan python instead of local environment, the first not having PyPDF2 installed while the second did. Check your current python environment.

Alvaro Rodriguez Scelza
  • 3,643
  • 2
  • 32
  • 47