Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

It is easy to find questions asking if one should start with python 2 or python 3, and it is a consensus that python 2 is the way to go as it is has more libraries and thus better supported.

Python 3 was launched back on 2008 and this question already addressed a migration. As it was too soon, the solution was to wait.

5 years have passed now and a good bunch of libraries already support python 3. At the time I write this question, according to this page 244 packages on pypi support python 3 while 156 does not. On the top 30 most downloaded packages, 24 support python 3

Following this I feel safe enough to start migrating from python 2 to 3 and also avoiding telling people to start on python 2

My reasons explained, the question is:

What concerns should I have when migrating from python 2 to 3?

Not just code syntax and replacements, as its easy to find a conversion tool to do the 80% of the job, but general concerns, like:

  • Do virtual environments mechanism changes?
  • Building, packaging and distribution differences
  • Will I have only cPython? (Looks like Jython has a long way to go to reach python 3)
  • Multi threading/processing programming. Always a delicate subject
  • Testing. Any changes?
  • What common things that I can still do like in python 2 but I should stop and start doing in an other way? I feel that a code replacement tool will change the code to make it just "runnable", but it will not use the correct or better option if the option itself involves big changes

ps: This question was asked on stack overflow, but was closed as too broad. Anyway, I felt that the correct place is here

share|improve this question

closed as too broad by Jim G., BЈовић, Martijn Pieters, MichaelT, thorsten müller Jul 10 '13 at 14:51

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If something is too broad on one site, it is likely too broad on another site. The best course of action in this case is to identify a specific problem that you are having with the migration. –  MichaelT Jul 8 '13 at 15:02
    
Stackoverflow is more direct and deal more with coding issues. My issues with python migration are more about the programming practice than programming itself. About the question being broad, I have to disagree. The points I suggested are just examples and I think that the subjectiveness of the question falls into the good subjective category –  Bruno Polaco Jul 8 '13 at 17:07
    
Of note, ideally one will flag a question to get it moved to another site rather than reposting it on other sites. It helps keep things clean and answers where they can be found in one place. –  MichaelT Jul 8 '13 at 17:41
add comment

1 Answer

Largely depends on the project.

Choose the version with which the libraries you need will work.

Almost everything will work on Python 2.x, but if you find that your dependencies are also available for Python 3.x, then use 3.x.

As for migration, this page covers all the differences (there doesn't seem to be any change on the multithreading/processing front compared to 2.x, but I could be wrong).

Virtualenv works with Python 3 since 1.6, with fixes for each new Python version in subsequent releases.

As for alternative Python implementations, that depends on the implementation itself, but most of them are still 2.x only for the time being.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.