This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
python 2.6 or python 3.1?
Hi,
I'm new to the python world and it seems that there are currently two parallel versions in development, which would be the 2.7 versus the 3.1.2. I'm wondering what version should I use to start, and why?
Stay with 3.1.2 if you want to be on the bleeding edge.
Stay with 2.7 if you want to leverage any 3rd party libraries that haven't been ported to 3.1.2 yet or can't be backward compatible.
I'd suggest Python 3 as it has incorporated several fixes to remove some of Python's previous "warts". The primary reason for maintaining the 2.7 version is for older packages that haven't yet made the transition. There are good reasons to use 2.7 but if you're starting out, you might as well start on the path leading to the future.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm starting a new open-source software in Python, and I'm wondering whether I should use Python 2.x or Python 3.x.
It will include a heavy GUI, complex scientific algorithms dealing with large amounts of data. I'll need at least Numpy, Scipy, PyQT4, PyOpenGL, h5py, optionaly Matplotlib. It should first be released in 2013, with updates and extensions during the next few years.
It will be used by scientists that do not necessarily have a background in computer science, on a wide variety of computers (Linux, Windows, Mac...). Some machines may be old.
If I choose Python 3.x, I fear that the software and the third-party libraries may be more complicated to install, especially on old systems where Python 2.x is already installed. It would be better if RPM-like packages (or Windows installers) for Python and the external libraries were available on most systems, such that one doesn't need to compile everything. Also, I don't know if the 3.x branch is mature enough.
If I choose Python 2.x, I may need to port the software to Python 3.x in the near future if the 2.x branch becomes deprecated (when will that happen?).
What would be the best option?
UPDATE: My original answer was given in 2012. However, now, years later, the answer should and must be Python 3.
This wiki discusses exactly your question: Should I use Python 2 or Python 3 for my development activity?
This is a very large subjective part to this question which depends on exactly your specific situation and constraints.
IMO, however, if you can't be sure that all 3rd party libraries you need will work with Python v3.x I would stick with Python 2.x but try to write code to be as compatible with Python 3.x as much possible (e.g., print() etc) so that if you ever need or want to migrate to v3 your work won't be so challenging. And of course there are documentation and tools on moving from version 2 to 3. And this on porting v2 code to v3.
This will especially be the case on systems where you don't have control or can't install newer versions of Python or customize the installation of 3rd party software/libraries.
Given that your software will be run on a wide variety of systems (Linux, Windows, Mac ..) and by a number of different users I still think that v2 is more of a common denominator these days.
So, short-attention-span summary: Use version 2.x but perpare your code for v3.x
Finally, if you put this search string "[python] version 3 or 2" into the SO search box, you'll find a number of related posts:
Python 3. (The answer to this question has changed!)
Python 2 is for legacy projects. New projects should lean towards Python 3.
The reason for this is that Python 3 (now 3.6) is roughly getting a new release each year. It has also been stable for many years (is in its tenth release year!). In contrast, Python 2 (still 2.7) has changed little in the last several years and will continue to grow stagnant.
For more information:
https://wiki.python.org/moin/Python2orPython3/
I agree with Levon.
With those requirements, I wouldn't risk starting in Python3 yet, but you should write your code taking as many of Python3 changes into consideration as possible.
See this question Writing Python 2.7 code that is as close to Python 3.x syntax as possible as it might help you with some imports and standards that you can use to make your code as future-proof as possible.
Also, if you're running in a variety of systems, you'd need to either distribute your version of python bundled in the application, or trust the installation of the user. Most OS's (non-windows), come with a 2.x flavor of Python installed, and it's not trivial for a non-techie user to upgrade to 3.x without the possibility of breaking the system.
This question already has answers here:
End of support for python 2.7?
(8 answers)
Closed 3 years ago.
i've heard that python 2.7 will be removed or something like that. And i just starter so i'm confused if i should start with python 2.7 or the newest one 3.7?
Yes, https://pythonclock.org/
Python 2.7 will not be maintained past 2020.
Until you discover an explicit reason otherwise, use the current stable versions of all software and hardware dependencies to start a project. Some software (e.g. Node.js or browsers) have special releases on the long term support track (LTS), but Python versions should be all equal in this regard, so 3.7 is a good choice in 2019.
An explicit reason might be integration with existing libraries (that do not work on current version and cannot be updated or replaced), or other business reasons.
This question already has an answer here:
Making something compatible with python 3 and 2
(1 answer)
Closed 4 years ago.
does anyone know which jython version compatible with python 3.6. I checked the jython release note, didn't get a clear clue. Thanks
There currently is no official jython 3.x version. There is a github repro, put that is unfinished. You can try that, put it will propably not work. So no, I don't believe you can use CPython 3.6 code and use it on jython without any code changes. It would be the easiest to use CPython or change the code to fit python 2.7
I used Python a few years ago when 2 was the only version.
Now there is 2 and 3.
Was there a a reason 2 hasn't continued to upgrade and now there is a split into two different pythons? Like no one uses Python 2.5. They all use 2.7 or whatever it is. Why not just use 3? Obviously there's a reason, but I was unable to find it googling.
My second question is, which one should I use? I am assuming 3, but that's ONLY based on the higher number. I wonder why 2 is still around if 3 is out??? If there aren't any major bugs with 3, I am just going to use that as I don't reckon it much matters: either one would probably work for py QT.
Why not just use 3?
A lot of existing Python code is not compatible with Python 3 yet. If you need to use Django for example you are forced to use Python 2.x.
My second question is, which one should I use?
Python 3 and PyQt 4 recommendations
Python 3 is significantly different than Python 2.x, and breaks numerous libraries and likely a lot of other dependent code. Python 2.x will likely be around for quite a while, as libraries are ported and 3.0 is field-tested.
it costs a lot to upgrade from python 2.x to python 3, that's why my project still uses python 2.7
The latest Ubuntu doesn't ship with Python 3. 12.04 will but that's not out yet.
OpenBSD doesn't have a package for Python 3, either.
Some people may just not have Python 3 on their platform and don't care to compile.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can I install python 3.x and 2.x on the same computer?
I am learning Python which I started with 3.2. Now I know basics and want to use some frameworks to learn web development. Here, I came to notice Django doesn't supports Python 3x yet.
So, I need to use Python 2x on same machine. How can I install both?
PS. I am currently using Windows XP.
Just install them normally. By default each version of Python is installed to a different path, and won't conflict. Python 3 and Python 2 don't even use the same executable name (python vs python3), so there's not a lot to worry about.
they will install into C:\Python27, and C:\Python32 by default.
no conflicts.
i didn't want to answer this but i have to since you might have a problem that no one is talking about lol
first don't install python from the official website go to activestate and download activepython for python 2,7
here's a direct link
http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-win32-x86.msi
activepython will help a lot when downloading packages trust me, so to install django, open pypm and type pypm install django
learn python 2.x and not 3.x because:
1-All the modules work on 2.x and not 3.x, python is a modular language, it's useless if you can't find modules
2- python 2.x will be there for at least 5 years so there's a long time for you to get started on 3.x maybe by then it will be more supported
3-now we are using 2.7, starting from 2.5 python started doing small changes to help programmers have a smooth transition from 2.x and 3.x, so when 2.9 arrives it will look a lot like 3.x
4-if you installed 2.7 and 3.2 on xp and lets say you made 2.7 your default version, which is the right thing to do, then there's a big possibility that 3.2 won't work, it will give you this error: Error runtime
program C:\python32\pythonw.py
this application has requested the runtime to terminate it in an unusual way, please contact the application support team for more information
so it will just give you a headache lol