Python version recommendation [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have developed some internal tools at work using Python. I have been using version 2.5 (or 2.6/2.7) for that and my personal projects as they would work fine with Django and GAE. My question is - should I be switching to version 3 or shall I wait and continue to work with 2.5/2.6/2.7. How stable is 3.0 as compared to 2.x? And what is the switching curve? Thanks.

Python 3 isn't supported by Django and quite a few other notable projects. Although Python 3 (current version is 3.2.1 IIRC) is plenty stable, that's not the issues. The real issue is adoption and library support, and Python 3 does not have enough of either yet. I don't know of anyone using it in production.
The learning curve for switching is pretty small. You can pretty much learn everything you need from What's New in Python 3, and most porting of code is pretty trivial.
I would not recommend that you switch anything that you use in production or professionally to Python 3. For your personal projects, it's okay to use Python 3 as long as the libraries you are using support it (for example, a Django project would not be able to use Python 3). Likewise for AppEngine; for that, you'll have to stick to Python 2.5.
So, in short, you can play around with Python 3, but it's not wise to use it at work because it likely does not support the libraries that you need, and it's not widely installed like Python 2.x is. I'd start thinking about Python 3 and familiarize yourself with it, but don't switch just yet.
You may also be interested in Should I Choose Python 2 or 3.

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.

Django - Use Python3 or 2.7? Longevity and performance of project [closed]

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 7 years ago.
Improve this question
Although this could be downvoted as an opinion based issue, I suspect there is a concrete answer to this:
I want to create a future-proof django project.
I want to maintain the best coding standards
I do in fact require a diversity of other python modules for the apps I am creating
I am shooting for best performance
With that in mind, should I stick to python2.7 because of it's great support and use? Or would it be better to use python3 because it is the way of the future?
Django's official stance is, as long as your dependencies support Python 3, to use Python 3. Python 3 has and will continue to receive new features and improvements, including better performance.
Unless you need modules that would be hard to port to Python 3 (simple ones can often be fixed just by running the builtin 2to3 tool), there isn't any reason not to use Python 3.
If the Python modules required are available for Python 3.x, then I would go ahead with the latest stable release. If not, don't be afraid to use Python 2.7 since performance is great and many 3.x improvements have been backported.
However, take into account that sooner or later you'll have to migrate to Python 3.
I would stick to python 2.7. It is more commonly used, and has lots of support.

Still no wxPython for Python 3 (or 3.3) yet? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I wanted to start working with wxPython, but I found out that it isn't updated for Python 3. I'm using the newest verion of Python, 3.3 that is.
So I started looking on the web and found some people who said there wasn't, but these threads were like 3 years old.
So my question: Is there still no wxPython update for Python 3? Python 3 has been out for a couple of years now! There should be, right?
Thanks
wxPython 4 is here and supports Python 2.7 and 3.5. It can be found on PyPI - https://pypi.python.org/pypi/wxPython and is installed via pip:
pip install wxPython
If you want to try the bleeding edge, there are snapshot builds here:
http://wxpython.org/Phoenix/snapshot-builds/
You will also want to check out the Migration Guide and the Classic vs Phoenix documentation page for more information about the changes to wxPython
ProjectPhoenix is in development and will allow wxpython to work with python3.
I couln't tell you how long it will be till it is released but i think it can be used already to a certain extent.
How "stable" is Phoenix
Phoenix status

Python Legacy - Scapy on Windows (Python 2.4) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have a machine that has Python 2.4, I am unable to upgrade it to a newer edition.
Also, I need to use scapy on this machine (windows)
I have searched for a scapy version for python version less than 2.4 but only found it for UNIX.
Can anyone help me find a scapy version / port to windows?
thanks
According to the Scapy Download and Installation Documentation, Scapy v1.x is your only option if you are running Python 2.4.
To install Scapy v1.x follow the instructions here. The documentation does state that Scapy has been designed for unix-like systems, but it does support Windows.
According to the official site, scapy is designed with linux in mind. Everything you should need is here. But, it looks like some of the utilities that scapy depends on do not support anything older than 2.5.
Can you use py2exe to bundle a different python interpreter with your app? Since you have to stick the app on the machine anyway, why not just give them a single "executable" with a different version of python compiled in.
You could use NSIS to install the thing, along with the appropriate dependencies. I.E. libpcap and friends for your version of python and scapy.

Is there an equivalent of PyMongo for Python 3.2? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I attempted to install pymongo to my Windows box with Python 3.2 through easy_install, only to find that it will not install due to incompatibilities with Python 3.2.
Therefore, is there an equivalent to pymongo that will work with Python 3.2? MongoDB is an integral part of the application I was developing on Python 2.7, and to move to Python 3.2 I will need to retain this interactivity.
Thanks!
Edit: this answer is outdated. PyMongo now officially supports Python 3.
The answer was already given in comments, but I'll provide a comprehensive summary nontheless:
As of May 2011, Python 3 is not officially supported by MongoDB
Ticket for "Support for Python 3" has been some years ago (https://jira.mongodb.org/browse/PYTHON-84) so the MongoDB developers are aware of this need.
As already told by Adam, there is a port of PyMongo for Python 3 in PyPi (http://pypi.python.org/pypi/pymongo3) which could be used and is defined as "semi-official"
Source codes for the Python 3 fork are available at https://github.com/sovnarkom/mongo-python3-driver
If you want make on impact on making this fork official make an upvote to its ticket (https://jira.mongodb.org/browse/PYTHON-84)
With enough upvotes/user requests, I would expect to get an official Python 3 driver someday
Starting with the 2.2 release PyMongo supports python 3.x where x >= 1.
http://pypi.python.org/pypi/pymongo
http://api.mongodb.org/python/current/python3.html
Via freenode and #web.

Categories

Resources