pythonpython-3.xpycharmubuntu-16.04odoo-11

Odoo 11 : ImportError No Module Named 'PyPDF2'


I'm using a script to run Odoo11 via PyCharm in Ubuntu (openerp_openserver script)

script

When I try to run the program, it fails at some point, when it import pdf module and I have this error:

ImportError No Module Named 'PyPDF2'

as you can see in this image:

enter image description here

I Already installed PyPDF2 via this command (i have python3.5 already installed) :

sudo apt-get install python3-pypdf2

enter image description here

So I'm wondering, what is the problem, why PyCharm cannot find and import pypdf2?

EDIT:

When I Try to import PyPDF2 using the Python command, I don't have error

enter image description here


Solution

  • Firstly you should try to check whether you can import PyPDF2 library from a Python console.

    Run from your native console:

    python3 -c "import PyPDF2"
    

    If no error message occurs, the problem is not in the library.

    Check a path of python interpreter that is used by PyCharm.

    Navigate inside PyCharm:

    Ctrl-Alt-S > Build, Execution Deployment > Console > Python Console
    

    The path should be to /usr/bin/folder.

    If not - change it to a path of the desirable python interpreter that is inside /usr/bin/ folder.

    Will be good if someone can add a way to solve this type of problem in Windows environment.