Python 2 interpreter instead of 3 in Geany

Clash Royale CLAN TAG#URR8PPP up vote
0
down vote
favorite
On my PC, Python 2 and 3 are installed â a query of the versions, using the terminal, outputs the following:
$ python2 --version
Python 2.7.14
$ python3 --version
Python 3.6.3
I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:
#!/usr/bin/env python3
I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:
print(sys.version_info)
sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)
How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.
So, hereâÂÂs my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW â I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; IâÂÂd be very thankful.
python python3 geany shebang
add a comment |Â
up vote
0
down vote
favorite
On my PC, Python 2 and 3 are installed â a query of the versions, using the terminal, outputs the following:
$ python2 --version
Python 2.7.14
$ python3 --version
Python 3.6.3
I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:
#!/usr/bin/env python3
I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:
print(sys.version_info)
sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)
How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.
So, hereâÂÂs my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW â I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; IâÂÂd be very thankful.
python python3 geany shebang
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
On my PC, Python 2 and 3 are installed â a query of the versions, using the terminal, outputs the following:
$ python2 --version
Python 2.7.14
$ python3 --version
Python 3.6.3
I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:
#!/usr/bin/env python3
I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:
print(sys.version_info)
sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)
How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.
So, hereâÂÂs my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW â I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; IâÂÂd be very thankful.
python python3 geany shebang
On my PC, Python 2 and 3 are installed â a query of the versions, using the terminal, outputs the following:
$ python2 --version
Python 2.7.14
$ python3 --version
Python 3.6.3
I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:
#!/usr/bin/env python3
I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:
print(sys.version_info)
sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)
How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.
So, hereâÂÂs my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW â I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; IâÂÂd be very thankful.
python python3 geany shebang
python python3 geany shebang
edited Feb 18 at 0:14
wjandrea
7,24342256
7,24342256
asked Feb 17 at 21:22
Torsten_K
363
363
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
You have to modify the file /usr/share/geany/filetypes.python by
replacing the 2 occurrences of <=python> with <=python3>:
sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python
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
You have to modify the file /usr/share/geany/filetypes.python by
replacing the 2 occurrences of <=python> with <=python3>:
sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python
add a comment |Â
up vote
1
down vote
You have to modify the file /usr/share/geany/filetypes.python by
replacing the 2 occurrences of <=python> with <=python3>:
sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You have to modify the file /usr/share/geany/filetypes.python by
replacing the 2 occurrences of <=python> with <=python3>:
sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python
You have to modify the file /usr/share/geany/filetypes.python by
replacing the 2 occurrences of <=python> with <=python3>:
sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python
edited Feb 18 at 14:56
jokerdinoâ¦
32k21118185
32k21118185
answered Feb 18 at 12:32
Jean Xana
112
112
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2f1007196%2fpython-2-interpreter-instead-of-3-in-geany%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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