Running a Python script in Conda virtual environment as service

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I recently wrote a Python program that is designed to communicate via SMPP SMS server.
The issue I'm facing is that I don't know how to run a Python script as a service on my Cent OS server using Conda virtual environment. I'm using a lot of dependencies and choosing virtual environment over Conda is not an option.
Is there any way I could run this script as a service? Also is there a way to write console methods to start this script using the following?
service fooService start
python services anaconda start-stop-daemon virtualenv
add a comment |Â
up vote
1
down vote
favorite
I recently wrote a Python program that is designed to communicate via SMPP SMS server.
The issue I'm facing is that I don't know how to run a Python script as a service on my Cent OS server using Conda virtual environment. I'm using a lot of dependencies and choosing virtual environment over Conda is not an option.
Is there any way I could run this script as a service? Also is there a way to write console methods to start this script using the following?
service fooService start
python services anaconda start-stop-daemon virtualenv
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I recently wrote a Python program that is designed to communicate via SMPP SMS server.
The issue I'm facing is that I don't know how to run a Python script as a service on my Cent OS server using Conda virtual environment. I'm using a lot of dependencies and choosing virtual environment over Conda is not an option.
Is there any way I could run this script as a service? Also is there a way to write console methods to start this script using the following?
service fooService start
python services anaconda start-stop-daemon virtualenv
I recently wrote a Python program that is designed to communicate via SMPP SMS server.
The issue I'm facing is that I don't know how to run a Python script as a service on my Cent OS server using Conda virtual environment. I'm using a lot of dependencies and choosing virtual environment over Conda is not an option.
Is there any way I could run this script as a service? Also is there a way to write console methods to start this script using the following?
service fooService start
python services anaconda start-stop-daemon virtualenv
python services anaconda start-stop-daemon virtualenv
edited Sep 27 '16 at 14:43
Tomasz
8,30552560
8,30552560
asked Jul 29 '16 at 22:43
David Swan
1112
1112
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Sorry this comes late, but the way to run a python script within a particular environment is to write a shell script like this:
#!/bin/bash
source activate my_env && python my_script.py
and have that wrapper script as your service instead of the python script itself.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Sorry this comes late, but the way to run a python script within a particular environment is to write a shell script like this:
#!/bin/bash
source activate my_env && python my_script.py
and have that wrapper script as your service instead of the python script itself.
add a comment |Â
up vote
1
down vote
Sorry this comes late, but the way to run a python script within a particular environment is to write a shell script like this:
#!/bin/bash
source activate my_env && python my_script.py
and have that wrapper script as your service instead of the python script itself.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Sorry this comes late, but the way to run a python script within a particular environment is to write a shell script like this:
#!/bin/bash
source activate my_env && python my_script.py
and have that wrapper script as your service instead of the python script itself.
Sorry this comes late, but the way to run a python script within a particular environment is to write a shell script like this:
#!/bin/bash
source activate my_env && python my_script.py
and have that wrapper script as your service instead of the python script itself.
answered Oct 10 '16 at 18:57
Tunisia
111
111
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f299192%2frunning-a-python-script-in-conda-virtual-environment-as-service%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password