0

In Debian 10 (buster) I wan't to schedule a task with cron. This task is a python script who create a csv file. This python script start with:

import xmlrpc.client
import csv

When I execute it, without any cron task, I have this message:

/usr/bin/python /home/debian/api_odoo_contact.py

Traceback (most recent call last):
  File "/home/debian/api_odoo_contact.py", line 1, in <module>
    import xmlrpc.client
ImportError: No module named xmlrpc.client

How to resolve this modules dependencies ?

Do I have to install modules on my server before excuting the script and define their paths in my python script ?

1 Answer 1

3

xmlrpc.client is a Python 3 library (it was xmlrpclib in Python 2), so you need to specify a Python 3 interpreter:

/usr/bin/python3 /home/debian/api_odoo_contact.py

In Debian 10, /usr/bin/python is a Python 2 interpreter.

0

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .