Is it true that python 2.7 will die soon? [duplicate] - python

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.

Related

Different version of python installed [duplicate]

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.

does jython 2.7 compatible with python 3.6 code [duplicate]

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

How can I check which version of Python is required to run my script? [duplicate]

This question already has answers here:
How to detect minimum version of python that a script required
(2 answers)
Closed 1 year ago.
I wrote a Python program, and I'm using a library that requires Python >= 3.0. When I wrote some code, I used some syntax introduced in 3.2, maybe 3.6, it was a long time ago! So now I have this piece of code, which will surely not run on Python 2.6, or Python 3.0, but I don't know exactly the minimum version required to run my script.
So, how can I find out what's the minimum Python version that runs my script?
The tox library allows you to test a package using multiple versions of python. That will help you find out which versions your package will run on.
This requires a test script (such as unit tests) that exercise your code sufficiently to surface issues.

How can I install Python 3x and 2x into same machine? [duplicate]

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

Python 2.7 or 3.1.2? [duplicate]

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.

Categories

Resources