How to replace python 3 installation with python 2.7
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.
What command to run so python application.py runs it on python 2.7
python python-2.7
New contributor
add a comment |Â
up vote
1
down vote
favorite
I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.
What command to run so python application.py runs it on python 2.7
python python-2.7
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.
What command to run so python application.py runs it on python 2.7
python python-2.7
New contributor
I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.
What command to run so python application.py runs it on python 2.7
python python-2.7
python python-2.7
New contributor
New contributor
New contributor
asked 1 hour ago
SID
61
61
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
To control which version of python add this line to top of your script
#!/usr/bin/env python2
alternatively execute your python script using your chosen python version
/usr/bin/python2 /full/path/my/script
similar steps will enable you to use python3 instead of python2 assuming your script imports are 3
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
To control which version of python add this line to top of your script
#!/usr/bin/env python2
alternatively execute your python script using your chosen python version
/usr/bin/python2 /full/path/my/script
similar steps will enable you to use python3 instead of python2 assuming your script imports are 3
add a comment |Â
up vote
2
down vote
To control which version of python add this line to top of your script
#!/usr/bin/env python2
alternatively execute your python script using your chosen python version
/usr/bin/python2 /full/path/my/script
similar steps will enable you to use python3 instead of python2 assuming your script imports are 3
add a comment |Â
up vote
2
down vote
up vote
2
down vote
To control which version of python add this line to top of your script
#!/usr/bin/env python2
alternatively execute your python script using your chosen python version
/usr/bin/python2 /full/path/my/script
similar steps will enable you to use python3 instead of python2 assuming your script imports are 3
To control which version of python add this line to top of your script
#!/usr/bin/env python2
alternatively execute your python script using your chosen python version
/usr/bin/python2 /full/path/my/script
similar steps will enable you to use python3 instead of python2 assuming your script imports are 3
answered 48 mins ago
Scott Stensland
4,18442239
4,18442239
add a comment |Â
add a comment |Â
SID is a new contributor. Be nice, and check out our Code of Conduct.
SID is a new contributor. Be nice, and check out our Code of Conduct.
SID is a new contributor. Be nice, and check out our Code of Conduct.
SID is a new contributor. Be nice, and check out our Code of Conduct.
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%2faskubuntu.com%2fquestions%2f1079762%2fhow-to-replace-python-3-installation-with-python-2-7%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