Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
on a system w/o python3
#11
That might of been true 5-7 years ago, but most 3rd party modules are already ported to python3.x by now.
https://python3wos.appspot.com/

Arch and gentoo have come default with python3.x for many years now. Ubuntu is always late if they are still using python2.x. If you dont have python3, then install it. IF you dont have permission to install, you can use a USB python to run it.

running the latest is not always the best option. When you write code, you usually freeze it to run that specific version as with any software.
Recommended Tutorials:
Reply
#12
(Nov-07-2017, 09:19 PM)metulburr Wrote: but lately ... 2.x is dead.
That's true,i would not have make any effort at all to support Python 2,if should release some Python stuff today.
Also 3.6(the biggest python 3 release with 16 new PEP) and core change to dictionary smaller/faster and ordered.
This really break a lot,so no effort should be used to port back to 2 (some have done it with f-string sigh) Hand

It's also good that big library make a clear statement of the way forward.
Like Django 2.0 soon to be released(no support for Python 2 at all) and Requests(yellow statement).
Quote:NoteThe use of Python 3 is highly preferred over Python 2.
Consider upgrading your applications and infrastructure if you find yourself still using Python 2 in production today.
If you are using Python 3, congratulations — you are indeed a person of excellent taste. —Kenneth Reitz
Reply
#13
as mentioned in my initial post, the problem is with Amazon Linux.  it does have Python 3.4, 3.5, and 3.6 in its yum repository, but it fails to install due to a packaging conflict.  Ubuntu Linux is the alternative in AWS but IPv6 does not work in the EC2 image of it, and its image is 4x as large (both of these issues are show stoppers).  i have raised the issue but expect it to take some time.  in the mean time, i'm trying to get my scripts to work in python2.  it's not the Python code that prevents them from working; it's the lack of "python3" in the executable search path.

in the near future, when python2 is no longer supported, will the name "python" be recycled and thus run what we today know to be python3?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#14
Quote:in the near future, when python2 is no longer supported, will the name "python" be recycled and thus run what we today know to be python3?
Yes. In Arch or Gentoo linux python refers to python3 and you actually have to put a number for 2.x python2
I could only assume all other distros would follow suit.

Quote:but it fails to install due to a packaging conflict.
What is the actual error?
Have you tried to compile it from source instead?
Recommended Tutorials:
Reply
#15
(Nov-08-2017, 01:42 PM)metulburr Wrote: I could only assume all other distros would follow suit.
no, they do not.

i was under the impression the link name "python" referring to "python2" was installed by the python source install, and thus, was a standard.  if not, then i can change the link myself on systems with python3 and leave it alone on systems without python3 ... so scripts with #!/usr/bin/env python will run the best python on that system.

my Ubuntu 16.04 LTS system has both python2 and python3 but the name python refers to python2:
Output:
lt1/forums /home/forums 1> (for p in $(echo "$PATH"|tr : ' ');do ls -dl $p/python*;done) ls: cannot access '/home/forums/.bin/python*': No such file or directory ls: cannot access '/home/forums/.cmd/python*': No such file or directory ls: cannot access '/home/forums/bin/python*': No such file or directory ls: cannot access '/home/forums/cmd/python*': No such file or directory ls: cannot access '/usr/local/cmd/python*': No such file or directory ls: cannot access '/usr/local/bin/python*': No such file or directory lrwxrwxrwx 1 root root       9 May  2  2016 /usr/bin/python -> python2.7 lrwxrwxrwx 1 root root      16 Dec  9  2015 /usr/bin/python-config -> python2.7-config lrwxrwxrwx 1 root root      13 Dec  9  2015 /usr/bin/python-dbg -> python2.7-dbg lrwxrwxrwx 1 root root      20 Dec  9  2015 /usr/bin/python-dbg-config -> python2.7-dbg-config lrwxrwxrwx 1 root root       9 May  2  2016 /usr/bin/python2 -> python2.7 lrwxrwxrwx 1 root root      16 Dec  9  2015 /usr/bin/python2-config -> python2.7-config lrwxrwxrwx 1 root root      13 Dec  9  2015 /usr/bin/python2-dbg -> python2.7-dbg lrwxrwxrwx 1 root root      20 Dec  9  2015 /usr/bin/python2-dbg-config -> python2.7-dbg-config -rwxr-xr-x 1 root root     151 Nov 23  2015 /usr/bin/python2-pbr -rwxr-xr-x 1 root root 3546104 Nov 19  2016 /usr/bin/python2.7 lrwxrwxrwx 1 root root      33 Nov 19  2016 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config -rwxr-xr-x 1 root root 6414496 Nov 19  2016 /usr/bin/python2.7-dbg lrwxrwxrwx 1 root root      37 Nov 19  2016 /usr/bin/python2.7-dbg-config -> x86_64-linux-gnu-python2.7-dbg-config lrwxrwxrwx 1 root root       9 May  2  2016 /usr/bin/python3 -> python3.5 lrwxrwxrwx 1 root root      16 Mar 23  2016 /usr/bin/python3-config -> python3.5-config -rwxr-xr-x 2 root root 4456240 Sep 18 11:59 /usr/bin/python3.5 lrwxrwxrwx 1 root root      33 Sep 18 11:59 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config -rwxr-xr-x 2 root root 4456240 Sep 18 11:59 /usr/bin/python3.5m lrwxrwxrwx 1 root root      34 Sep 18 11:59 /usr/bin/python3.5m-config -> x86_64-linux-gnu-python3.5m-config lrwxrwxrwx 1 root root      10 May  2  2016 /usr/bin/python3m -> python3.5m lrwxrwxrwx 1 root root      17 Mar 23  2016 /usr/bin/python3m-config -> python3.5m-config ls: cannot access '/bin/python*': No such file or directory ls: cannot access '/usr/X11R6/bin/python*': No such file or directory lt1/forums /home/forums 2>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#16
I mean at some they will. Maybe not now. I would assume ubuntu 18.04 or at worse 20.04 would
Im not sure of ubuntu's projections on when they are getting rid of 2.x
Recommended Tutorials:
Reply
#17
I use mostly Arch Linux and python refers to python3. In the shebang line, I always put python3.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#18
(Nov-09-2017, 12:16 AM)metulburr Wrote: I mean at some they will. Maybe not now. I would assume ubuntu 18.04 or at worse 20.04 would
Im not sure of ubuntu's projections on when they are getting rid of 2.x

i certainly hope they will ... upgrade to python3 (including no scripts use python2).

(Nov-09-2017, 12:24 AM)wavic Wrote: I use mostly Arch Linux and python refers to python3. In the shebang line, I always put python3.

your script won't run on Amazon Linux.   since i have many add-on commands (re)written in python, this can be a show stopper for me.  so i use #!/usr/bin/env python and they work on both Amazon Linux and Ubuntu Linux and should work on systems with python->python3 and systems with python->python2.  i do have a few scripts that really need python3 due to use of bytes and utf-8 and such.

i am thinking of changing my (Ubuntu) system to python->python3 and see what happens.  i can change it back if i need to.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#19
Quote:i am thinking of changing my (Ubuntu) system to python->python3 and see what happens. i can change it back if i need t
I did that once and it messed my system up. But that was a few years ago.
Recommended Tutorials:
Reply
#20
Quote:i am thinking of changing my (Ubuntu) system to python->python3 and see what happens.  i can change it back if i need to.
I do not recommend this. Half of the system is run by Perl and Python scripts and changing the default versions could break the system.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020