top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the future Python 2 or Python 3?

+3 votes
611 views

The http://www.python.org site says that the future is Python 3, yet whenever I try something new in Python, such as Tkinter, everything seems to default to Python 2.

By this I mean that, whenever I find that I need to install another package, it shows up as Python 2 unless I explicitly specify Python 3.

What's the deal? If I want to make a distributable software package, should it be 2 or 3?

posted Dec 27, 2013 by Deepak Dasgupta

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
The future is indeed Python 3. The problem with the future is that it's  not here yet.

2 Answers

+1 vote

The past is Python 2; the future is Python 3. The present is both Pythons, running in parallel; if you're lucky, that's 2.7 and the latest 3.x, though not everyone has that luxury.

For new code, aim for Python 3 unless you have a good reason to go for Python 2. Most Linux distributions come with Python 2 under the name "python", and Python 3 under the name "python3"; stick with that and you'll be fairly safe. Or, if you can depend on your users having a recent Py3 installed, you can use the launcher packaged with 3.3 and later, which can intelligently figure out version.

answer Dec 27, 2013 by Seema Siddique
+1 vote

Always use 3 unless you absolutely have to use 2. Python 3 is not a shiny new thing. It is *five* years old at this point and is soon to have its *fifth* significant release. Python 2.6 is EOL, and there will not be a 2.8.

However, people have stayed with Python 2 for various reasons, and unfortunately, many of those people haven't even made an effort to migrate until the last year or so.

Most of the major third-party libraries these days are either 3.x compatible or have 3.x-compatible replacements, though.

answer Dec 27, 2013 by Seema Siddique
Similar Questions
0 votes

Elective 1 options: Artificial neural networks, digital image processing, statistical machine learning
Elective 2 options : genetic algorithm and its application, computer vision

+2 votes

I have two Questions:

  1. Could Python 3.2, when compiled against OpenSSL 1.0.0j, be affected by the poodle bug? https://www.openssl.org/~bodo/ssl-poodle.pdf

  2. If yes - are the following OpenSSL versions approved for use with Python 3.2:
    OpenSSL 0.9.8zf
    OpenSSL 1.0.0r
    OpenSSL 1.0.1m
    OpenSSL 1.0.2a

+2 votes

I am working on drawing map from shape file in Python 3.2 basemap. But, the longitude values at the bottom axis are only shown partially. Also, all latitude values are missing.

Here is my python code.

import shapefile as sf
import sys
import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.basemap import Basemap

 map = Basemap(projection='stere', lon_0=-106.4, lat_0= 31.9, lat_ts = 31.9, 
 llcrnrlat=31.7, urcrnrlat= 31.85, 
 llcrnrlon=-106.5 , urcrnrlon= -106.1, 
 rsphere=6371200., resolution='l', area_thresh=1000)

 plt.figure(num=None, figsize=(10, 8), dpi=80, facecolor='w', edgecolor='k')

parallels = np.arange(31.7, 31.85, 0.25)

map.drawparallels(parallels, labels=[0, 0, 0, 1] , fontsize=10, labelstyle='+/-', dashes=[2, 2])

meridians = np.arange (-106.5, -106.1, 0.25)

map.drawmeridians(meridians, labels=[0, 0, 0, 1], fontsize=10, labelstyle='+/-' , dashes=[2, 2])

No matter how I changed the labels, the latitude/longitude legend values are still missing.

+3 votes

Here is what I have tried:

root@secure [~]# which python3
/usr/bin/python3

root@secure [~]# which pip
/usr/bin/pip

root@secure [~]# yum install pip3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.secrel.com.br
 * epel: mirror.imt-systems.com
 * extras: centos.secrel.com.br
 * remi: mirror5.layerjet.com
 * updates: mirrors.ucr.ac.cr
Setting up Install Process
No package pip3 available.
Error: Nothing to do
...