Tuesday, July 7, 2015

PythonBoostrap to the rescue

It's been a long time since anything has happened over here - my real identity has been taking all the credit - but for my latest endeavor, I decided to revive the BreakingBytes moniker, and I am super excited to announce:

Python Bootstrap

What?

Python Bootstrap, or just Python Boots, is for folks just like me ...

  • who work in a Windows corporate environment,
  • who do not have administrative access to their computers,
  • who just want to use Python-2.7

Python Boots just works. Just unzip it and double click python.exe and you're ready to go. Add it to your PATH and you can use pip to install packages and idle as your basic editor.

Why?

There just isn't an open source version of Python-2.7 for Windows that you can just unzip and use. There are a few solution, but they are either closed source or depend on mingw-w64 or other non-standard Python toolsets. Python Boots is build with official Python.org source, using their own build batch scripts on AppVeyor from my cpython fork on BitBucket. Go ahead, send me a PR and make it even better.

How?

As I said, I use AppVeyor which has Visual Studio 2008 C++ compilers in the Windows SDK 7.0, the exact same toolset used to build official Python-2.7. The real issue is redistributing the Microsoft Visual C++ Common Runtime or msvcr90.dll that is used by Python. The official version uses merge modules packaged with the MSI that require administrative rights. The irony is that most Windows 7 computers will already have these redistributables installed. Another method is to have the user install the redistributables, either by downloading and installing them from Microsoft manually or by using ClickOnce. The method used by Python Boots is to install the redistributatble side-by-side privately. This just works, because Windows will always check WinSxS first for newer versions and if there are updates to the redistributables they will automatically get installed there.

So?

Python Boots will not register itself in the Windows registry. So, you can wipe the Python Boots folder at your leisure. But packages that use bdist_wininst won't find your installed Python so you'll have to use pip. Oh well.

No comments:

Post a Comment

Fork me on GitHub