Sample Header Ad - 728x90

Running python as service in ubuntu

0 votes
0 answers
373 views
I am currently trying to run python as a service in ubuntu. I am running into an error when trying to run it as a service. This is what my service looks like:
[Unit]
Description=PythonAPI

[Service]
Type=simple
ExecStart=/User/path/anaconda3/envs/envs-name/bin/python3 /path/to/executable


[Install]
WantedBy=multi-user.target
When I try to run the service I get this error ModuleNotFoundError: No module named 'hosting'. If I just run the ExecStart in the command line it seems to run no problem. Any reason why it wouldn't work in a service?
Asked by bob Ditusa (1 rep)
Aug 16, 2022, 05:42 PM