I have written a script that I need to run twice a day. My intention was to make the script and then run it as a cron job on the necessary schedule.
I wrote the script in the spyder IDE, and it runs flawlessly from there. I can also run it from the terminal by typing python python_daily_update.py.
I have added the #!/usr/bin/python statement to the front of the script and made it executable.
When I attempt to run the script from the command line without the 'python' proceeding it, I get a errors as follows:
$ python_daily_update.py
Failed to import the site module
Traceback (most recent call last):
File "/usr/lib/python3.4/site.py", line 586, in <module>
main()
File "/usr/lib/python3.4/site.py", line 572, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python3.4/site.py", line 287, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python3.4/site.py", line 263, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python3.4/site.py", line 253, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python3.4/sysconfig.py", line 597, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python3.4/sysconfig.py", line 540, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python3.4/sysconfig.py", line 412, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python3.4/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'
I'm running linux mint 17.1. I believe there is something wrong with the path but I can't seem to figure out what it is. Any ideas?