I am trying to run a python application as a Windows Service. The code I have installs and starts but I am having issues importing modules and classes which are part of the application.
Note:: Python libraries are being included fine.
I have checked the python path and all the correct values are in there, (including the application directory) which is leading me to believe that the windows service could be running in a different location.
Does a python application running as a windows service get run from a different location on windows?
python service creation using win32service
created the pythonservice.exe in C:\Python27\Lib\site-packages\win32
by default.
you can perform os.chdir(yourdir)
in your code just before service creation,
the best thing would be use absolute paths and setting proper sys.path within your script for accessing files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With