Showing posts with label python package. Show all posts
Showing posts with label python package. Show all posts

Thursday, 14 August 2025

ModuleNotFoundError: No module named 'psycopg2'

 Odoo 18: 

Traceback (most recent call last):

File "/home/bodedra/odoo18/demo/src/odoo/./odoo-bin", line 5, in <module>

import odoo

File "/home/bodedra/odoo18/demo/src/odoo/odoo/__init__.py", line 49, in <module>

_monkeypatches.patch_all()

File "/home/bodedra/odoo18/demo/src/odoo/odoo/_monkeypatches/__init__.py", line 28, in patch_all

from .lxml import patch_lxml

File "/home/bodedra/odoo18/demo/src/odoo/odoo/_monkeypatches/lxml.py", line 6, in <module>

from odoo.tools import parse_version

File "/home/bodedra/odoo18/demo/src/odoo/odoo/tools/__init__.py", line 10, in <module>

from . import template_inheritance

File "/home/bodedra/odoo18/demo/src/odoo/odoo/tools/template_inheritance.py", line 9, in <module>

from odoo.tools.translate import LazyTranslate

File "/home/bodedra/odoo18/demo/src/odoo/odoo/tools/translate.py", line 35, in <module>

from psycopg2.extras import Json

ModuleNotFoundError: No module named 'psycopg2'


Resolved with

pip3.12 install psycopg2-binary

 

Friday, 25 July 2025

How to install python3.12 in Linux?

First we have to add repository source code so open terminal and run following command:


sudo add-apt-repository ppa:deadsnakes/ppa

 


 

Next update the apt library:

 

sudo apt update

 

Finally, install python3.12 in your Linux system:

 

sudo apt install python3.12

 


Wednesday, 1 November 2023

ImportError: cannot import name 'utils' from 'PyPDF2'

Odoo 15:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/bodedra/odoo15/src/odoo/odoo/service/server.py", line 473, in target
    self.cron_thread(i)
  File "/home/bodedra/odoo15/src/odoo/odoo/service/server.py", line 429, in cron_thread
    from odoo.addons.base.models.ir_cron import ir_cron
  File "/home/bodedra/odoo15/src/odoo/odoo/addons/base/__init__.py", line 5, in <module>
    from . import models
  File "/home/bodedra/odoo15/src/odoo/odoo/addons/base/models/__init__.py", line 13, in <module>
    from . import ir_actions_report
  File "/home/bodedra/odoo15/src/odoo/odoo/addons/base/models/ir_actions_report.py", line 26, in <module>
    from PyPDF2 import PdfFileWriter, PdfFileReader, utils
ImportError: cannot import name 'utils' from 'PyPDF2' (/home/bodedra/odoo15/src/venv/lib/python3.8/site-packages/pypdf2-3.0.1-py3.8.egg/PyPDF2/__init__.py) 

Resolved with

pip install PyPDF2==1.26.0

Monday, 25 September 2017

ImportError: No module named googleapiclient

Recently, I have faced ImportError: No module named googleapiclient and I would like to share knowledge to fix that problem.

Open terminal and run following command to resolve it:

     sudo pip install --upgrade google-api-python-client

Tuesday, 7 February 2017

ImportError: No module named packaging.version

Recently, I face ImportError: No module named packaging.version  and I would like to share knowledge to fix that problem.

Terminal:

pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)



I am trying to upgrade pip

python -m pip install -U pip

    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "setuptools/__init__.py", line 12, in <module>
        import setuptools.version
      File "setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "pkg_resources/__init__.py", line 70, in <module>
        import packaging.version
    ImportError: No module named packaging.version
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "setuptools/__init__.py", line 12, in <module>

    import setuptools.version

  File "setuptools/version.py", line 1, in <module>

    import pkg_resources

  File "pkg_resources/__init__.py", line 70, in <module>

    import packaging.version

ImportError: No module named packaging.version



Solution:

sudo su root

apt-get purge -y python-pip


wget https://bootstrap.pypa.io/get-pip.py


python ./get-pip.py


apt-get install python-pip



Sunday, 21 June 2015

ImportError: No module named bs4 (BeautifulSoup)

Beautiful Soup is a Python library for pulling data out of HTML and XML files.

Recently face issue with python packages.

Server Traceback:

openerp@odedra-Lenovo-Z50-70:~$ python testing.py
Traceback (most recent call last):
  File "testing.py", line 1, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named bs4

Here is command for resolving issue on Linux.

sudo apt-get update
sudo apt-get upgrade
pip install BeautifulSoup4

For other OS you may advice to visit Here

Once you completed download the compressed file , decompress the file and then inside you will see a python file named setup.py. This is the install file of the package, you need to run a command prompt in the folder and execute following line :

python setup.py install

I hope you like this article. Share your views to improve content. Happy Learning !!!

Youtube Video

ModuleNotFoundError: No module named 'psycopg2'

  Odoo 18:  Traceback (most recent call last): File "/home/bodedra/odoo18/demo/src/odoo/./odoo-bin", line 5, in ...