I started using Python in early 2016, since then I have looked at hundreds of packages on github and pypi and I can't remember one of them being strictly Python2.
The "2 to 3 dilemma" doesn't exist in my life, even though I use Python on a daily basis. I guess it's because I'm late to the game and I'm not working in a big corp with lot's of legacy code. Or maybe it's the field? I use Python for web stuff and tooling.
Anyway.. in my life Python2 is history. The only time I hear from it is either threads like this one or code examples on old blog posts.
> can someone explain why Python 3 has never replaced Python 2?
I think this is inaccurate. Python3 may not have replaced Python2 for everyone, but it looks like it has replaced Python2 for most projects on github.
Part of it is that Python 3 does not offer any really strong reasons to switch to it, in an existing code base. It is definitely better and rounds out a bunch of small problems and inconsistencies that exist in Python 2. It also does have some cool new features. However, since Python 3 is not compatible with Python 2 (there is very good tooling for automatic converting and supporting both in one code base) many developers have not taken the time to port their code.
For us the primary reason is because not only is Python 2 the default in RHEL 6 and RHEL 7 (and thus downstreams like CentOS and Scientific Linux), they don't even ship with Python 3 or have it in the base yum repos, so getting it installed on our thousands of diverse systems is nontrivial.
Furthermore we have a large base of scripts, owned by many people, that use Python as they would use bash, so changing the default Python on them will be like linking /bin/bash and /bin/sh to /bin/csh.
Because Python 3 existed for 10 years now, and a lot of new Python 3 features were backported to 2.7. In fact all new features in 2.7 were copied from Python 3. People essentially said, "why should I migrate to Python 3 when it doesn't offer anything new and I don't care about unicode at all (in fact I like when I have to explicitly state what's unicode and what's not)"
Only after PSF declared in 2015 that 2.7 is maintenance-only and won't get any new features Python 3 picked up.
Many people say that reason for this is breaking changes, but the truth is people are lazy and they won't do extra work to convert until they get kick in the butt. Other languages did have breaking changes and people move on, because the old version was deprecated.
With Python for a long time not declaring EOL for 2.x people assumed 3.x will never happen and started resisting it. The FUD started and people were afraid of even trying it. It got to the point that someone was planning to release Python 2.8 that would backport all changes from Python 3 except unicode.
Python 3 broke backwards compatibility with Python 2. Most of the usefulness of Python comes from the fact that you can import modules. Since all of the existing modules had been written in Python 2 and would not work with Python 3, most people ignored the release of Python 3 and continued using Python 2.