Skip to Content
āđ€āļĄāļ™āļđ
āļ„āļļāļ“āļ•āđ‰āļ­āļ‡āļĨāļ‡āļ—āļ°āđ€āļšāļĩāļĒāļ™āđ€āļžāļ·āđˆāļ­āđ‚āļ•āđ‰āļ•āļ­āļšāļāļąāļšāļ„āļ­āļĄāļĄāļđāļ™āļīāļ•āļĩāđ‰
āļ„āļģāļ–āļēāļĄāļ™āļĩāđ‰āļ–āļđāļāļ•āļąāđ‰āļ‡āļ„āđˆāļēāļŠāļ–āļēāļ™āļ°
3 āļ•āļ­āļšāļāļĨāļąāļš
14679 āļĄāļļāļĄāļĄāļ­āļ‡
If someone created a module in Odoo, which uses Python modules for its working. So at the time of module installation if the system does not find Python packages installed in the system, it will raise an error and not allow to install the module. 😔

👉 To avoid this, I suggest you the following solution:
1- Create a Python file e.g.: setup.py 🙂
2- Add the following code (see code below) into the setup.py file ✍ïļ
3- Don't forget to call the setup.py file in your __init__.py file. 🧐

👉 Once all the previous step done, your Python packages will be installed automatically when you install the module. 😎

class Packages:
"""
This Class installs required Packages or library
"""

get_pckg = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in get_pckg.split()]
# List of your required packages
required_packages = ['dateparser', 'pandas-highcharts', 'scipy']
for packg in required_packages:
if packg in installed_packages:
pass
else:
print('installing package %s' % packg)
os.system('pip3 install ' + packg)
āļ­āļ§āļ•āļēāļĢ
āļĨāļ°āļ—āļīāđ‰āļ‡

I can't thank you enough!

Thank you so much. It was much needed.

āļ„āļģāļ•āļ­āļšāļ—āļĩāđˆāļ”āļĩāļ—āļĩāđˆāļŠāļļāļ”

Hello ,

Rob Bro,

It is looking like you dont have the pip "ggplot" . if you are running python2 install with command  "pip install ggplot" and if you are using python3 pip3 install ggplot . This will  solve your problem.

Thanks & Regards,

Jay R. Dasani

āļ­āļ§āļ•āļēāļĢ
āļĨāļ°āļ—āļīāđ‰āļ‡

Thank you for responding.It worked when I reomved 'external_dependencies': from manifest.

I'm glad that i solved your problem.

āļ„āļģāļ•āļ­āļšāļ—āļĩāđˆāļ”āļĩāļ—āļĩāđˆāļŠāļļāļ”

Thanks that is valuable information! :D :

āļ­āļ§āļ•āļēāļĢ
āļĨāļ°āļ—āļīāđ‰āļ‡
Related Posts āļ•āļ­āļšāļāļĨāļąāļš āļĄāļļāļĄāļĄāļ­āļ‡ āļāļīāļˆāļāļĢāļĢāļĄ
0
āļŠ.āļ„. 18
6971
2
āļ˜.āļ„. 16
9622
Order of installed modules āđāļāđ‰āđ„āļ‚āđāļĨāđ‰āļ§
1
āļĄ.āļ„. 22
3074
2
āļ.āļĒ. 16
6630
Military states module -- help :D āđāļāđ‰āđ„āļ‚āđāļĨāđ‰āļ§
1
āļĄāļĩ.āļ„. 15
4322