Live data from Hacker News

Using both Python 2 and 3 in Windows

spapas.github.io

11–20 of 44 posts

Re: Using both Python 2 and 3 in Windows

#11
post #9

A missing point here: If you have an accent in your username on windows, you are welcome to a kingdom of pain due to pip inability to process paths with non-ascii chars.

And with anaconda distribution, you can't have any special characters, nor spaces in the path of the installation directory. And, in some machines that have multiple users, the default installation directory is a hidden folder which causes all sorts of issues and requires a reinstall. Just some of the issues I've encountered running python workshops. Linux and Mac users have far fewer issues.

I believe the spaces issue was fixed in 5.0.1 for Windows - I haven't encountered any issues with it (and have anaconda in a path with spaces.)

Re: Using both Python 2 and 3 in Windows

#12
I get around this by installing both version of WinPython. It's super easy since you install them into separate directories. You can double click into the command prompt shortcut that links to the folder and use pip to your liking for each version. Changing the interpreter in PyCharm is about two clicks too.

Re: Using both Python 2 and 3 in Windows

#13
post #2

You know what? I appreciate the authors drill-down into the "how" of this issue but I'd like to focus on the "why". Why, has it taken so long to get off of python2.x- noted I understand that a few libraries cough twisted cough have been holding projects back that depend on them. But I haven't wrote a single block of code in half a decade that wasn't python 2.x and python 3.x compatible. At what point will we exclusiv…

It's insane to think that Python 2 is going to go away because of the existence of Python 3. That is simply not how computer languages work. Python 2 has more than enough critical mass to continue pretty much forever in some form. It is even a reasonable target for new development because it is pretty much guaranteed to be stable. I would not be surprised if there was another initiative to fix Python 2's Unicode hand…

> That is simply not how computer languages work.

True, not how major revisions work, indeed.

Elephant in the room is that this is a chicken/egg problem.

The best of both worlds is a temporary transition period where you can run both (like we want both IPv4 native and IPv6 native). Unfortunately because that doesn't get adopted either we get in a situation where people need to pick either.

Articles like these help, but I use Chocolatey to maintain software on a Windows system.

Re: Using both Python 2 and 3 in Windows

#14
post #8

Earlier quoted context omitted.

It's insane to think that Python 2 is going to go away because of the existence of Python 3. That is simply not how computer languages work. Python 2 has more than enough critical mass to continue pretty much forever in some form. It is even a reasonable target for new development because it is pretty much guaranteed to be stable. I would not be surprised if there was another initiative to fix Python 2's Unicode hand…

So true. Just last week I thought I would start to use python 3 because I was starting on a new project and had a new computer. I installed anaconda python 3 only to have it crash when starting jupyter because the new python 3 version doesn't support backtick quoting for some reason, and jupyter was using backtick quoting. Oh well, back to python 2 for me, which will be stable for at least 2 years. Hopefully by then,…

Jupyter doesn't use backstick quoting if you install it from Python 3.

Re: Using both Python 2 and 3 in Windows

#15
post #2

You know what? I appreciate the authors drill-down into the "how" of this issue but I'd like to focus on the "why". Why, has it taken so long to get off of python2.x- noted I understand that a few libraries cough twisted cough have been holding projects back that depend on them. But I haven't wrote a single block of code in half a decade that wasn't python 2.x and python 3.x compatible. At what point will we exclusiv…

It's insane to think that Python 2 is going to go away because of the existence of Python 3. That is simply not how computer languages work. Python 2 has more than enough critical mass to continue pretty much forever in some form. It is even a reasonable target for new development because it is pretty much guaranteed to be stable. I would not be surprised if there was another initiative to fix Python 2's Unicode hand…

> Python 3 took an approach that did not catch on.

In your world maybe, but 97% of the project and training I took part where python 3 since Python 3.5 came out. And this spans in a lot of companies and countries.

Re: Using both Python 2 and 3 in Windows

#16

Earlier quoted context omitted.

I think the library ecosystem has tipped over to focusing on Python 3. That doesn't really matter to people with large Python 2 codebases and no economic reason to transition them to 3.

Don't know how updated http://py3readiness.org/ is but according to it 346 of the top 360 libs support py3. Interesting missing libs for me is supervisor and ansible.

Ansible does support python 3:

$ python

Python 3.6.3 (default, Oct 6 2017, 08:44:35)

[GCC 5.4.0 20160609] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import ansible

As of supervisor, nobody embeds it in a python program. It's something you apt-get install or yum install, not pip install. So it doesn't matter.

Re: Using both Python 2 and 3 in Windows

#17
post #2

You know what? I appreciate the authors drill-down into the "how" of this issue but I'd like to focus on the "why". Why, has it taken so long to get off of python2.x- noted I understand that a few libraries cough twisted cough have been holding projects back that depend on them. But I haven't wrote a single block of code in half a decade that wasn't python 2.x and python 3.x compatible. At what point will we exclusiv…

The real reason is that the Python community has been TOO NICE.

NodeJS and Ruby broke everything.

What did they do ?

They said "move your butt" and gave a small windows of time.

Everybody moved.

Python ?

We gave 10 years. Created tools. Tutorials. A way to write Python 2/3 compatible programs. Then gave 5 more years.

The result ?

Nobody moved for 9 years and spread FUD on how hard it is.

But the reality is: most people are not Google. They don't have thousands of 2.7 files to convert.

If you have a 20k LOCS Python project, you can convert that in 2 days. After what you will get a MUCH, MUCH better Python version anyway so it's largely worth it.

Re: Using both Python 2 and 3 in Windows

#19
post #2

You know what? I appreciate the authors drill-down into the "how" of this issue but I'd like to focus on the "why". Why, has it taken so long to get off of python2.x- noted I understand that a few libraries cough twisted cough have been holding projects back that depend on them. But I haven't wrote a single block of code in half a decade that wasn't python 2.x and python 3.x compatible. At what point will we exclusiv…

Easy: python 2 works, and python 3 offers me nothing I need to justify any effort to port code. Python 3 is a different language from python 2 (so people keep saying), and there's no business case for changing my stack's language since my stack works fine right now.

Re: Using both Python 2 and 3 in Windows

#20
It is even easier using conda.[1] Install whichever you use the most (likely python3) using either the full anaconda installer or the simpler miniconda installer. Then use conda to create an environment that uses the other python release. One has another benefit: one can create custom environments for analyses where "dependency hell" is a common problem...

[1] https://conda.io/docs/

Post reply on HN