How to replace a Python 3 installation with Python 2.7
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I already have Python 3 installed on the server machine, and I want to replace that with Python 2.7 as the code I have to deploy is complaint with Python 2.7.
What command should I run so Python application.py runs it on Python 2.7?
python python-2.7
New contributor
add a comment |Â
up vote
3
down vote
favorite
I already have Python 3 installed on the server machine, and I want to replace that with Python 2.7 as the code I have to deploy is complaint with Python 2.7.
What command should I run so Python application.py runs it on Python 2.7?
python python-2.7
New contributor
2
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I already have Python 3 installed on the server machine, and I want to replace that with Python 2.7 as the code I have to deploy is complaint with Python 2.7.
What command should I run so Python application.py runs it on Python 2.7?
python python-2.7
New contributor
I already have Python 3 installed on the server machine, and I want to replace that with Python 2.7 as the code I have to deploy is complaint with Python 2.7.
What command should I run so Python application.py runs it on Python 2.7?
python python-2.7
python python-2.7
New contributor
New contributor
edited 13 mins ago
Peter Mortensen
1,03821016
1,03821016
New contributor
asked 7 hours ago
SID
161
161
New contributor
New contributor
2
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago
add a comment |Â
2
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago
2
2
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
To control which version of Python, add this line to the 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 Python 3 instead of Python 2, 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
4
down vote
To control which version of Python, add this line to the 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 Python 3 instead of Python 2, assuming your script imports are 3.
add a comment |Â
up vote
4
down vote
To control which version of Python, add this line to the 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 Python 3 instead of Python 2, assuming your script imports are 3.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
To control which version of Python, add this line to the 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 Python 3 instead of Python 2, assuming your script imports are 3.
To control which version of Python, add this line to the 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 Python 3 instead of Python 2, assuming your script imports are 3.
edited 1 hour ago
Peter Mortensen
1,03821016
1,03821016
answered 7 hours ago
Scott Stensland
4,20442239
4,20442239
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-a-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
2
I wouldn't recommend you replace your python version as that might (most probably) break something on the machine. Instead, install something like virtualenv.
â ÃÂïàú
5 hours ago