Crontab not working for python3.11 script

General support questions
Post Reply
riluallah
Posts: 2
Joined: 2023/04/20 16:39:05

Crontab not working for python3.11 script

Post by riluallah » 2023/04/20 16:49:17

Hi All,

We are running a script to send an email and it was successful when it was run manually but via crontab it won't work. It throws an error below. We use path of python3.11 for both. Weird thing is its working using python 3.6 in crontab but what we need is to work with 3.11.


smtplib.py", line 776, in starttls
raise RuntimeError("No SSL support included in this Python")
RuntimeError: No SSL support included in this Python

pjsr2
Posts: 610
Joined: 2014/03/27 20:11:07

Re: Crontab not working for python3.11 script

Post by pjsr2 » 2023/04/21 08:33:19

cron uses a limited set of environment variables, much more limited than the environment for an ordinary user.
When something runs from the command line but not from cron, it is most of the times a missing environment variable, or an environment variable with a different value. For example, PATH may contain far less directories.

riluallah
Posts: 2
Joined: 2023/04/20 16:39:05

Re: Crontab not working for python3.11 script

Post by riluallah » 2023/04/26 16:53:41

Hey pjsr2,

Thanks for your reply. I just declare the bash parameter on crontab and it works.

Post Reply