Cannot Import Python MySQL module when running a script using crontab

后端 未结 5 1930
悲哀的现实
悲哀的现实 2020-12-30 07:34

I am using crontab to run a python script that requires the module MySQLdb. When I run this script from the command line everything works fine. However, trying to run it usi

5条回答
  •  一生所求
    2020-12-30 08:22

    Try running

    sudo -H pip install MySQLdb
    

    (note the -H option). It worked for me with a similar issue with another package

提交回复
热议问题