bzr python-based installer requires 32-bit python on windows; unclear message

Bug #331342 reported by Chris West
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Bazaar Windows Installers
Confirmed
Medium
Unassigned

Bug Description

I have 64-bit python 2.5.2 installed correctly.

The installer claims:
---------------------------
Cannot install
---------------------------
Python version 2.5 required, which was not found in the registry.
---------------------------
OK
---------------------------

This is because it is foolish. Wonderful Windows has detected that it is a foolish 32-bit app, and has pointed it at the nice, safe, 32-bit only area of the registry via. the almight WoW64 emulation layer. This nice, safe 32-bit area of the registry lacks python, as there are no nice, safe pythons installed, only powerful 64-bit pythons.

If you forgive it this folly by allowing it out of the nice, safe box in which it's been placed, and you run it with far too many permissions for such a naïve little application, the post install script quoth:
*** Could not load Python ***

And finally, but possibly less relevantly:
C:\Users\Faux>\Python25\Scripts\bzr --version
bzr: ERROR: exceptions.NotImplementedError: We must have one of fcntl, pywin32, or ctypes available to support OS locking.

Traceback (most recent call last):
  File "C:\python25\lib\site-packages\bzrlib\commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\python25\lib\site-packages\bzrlib\commands.py", line 793, in run_bzr
    cmd_version().run_argv_aliases([])
  File "C:\python25\lib\site-packages\bzrlib\commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\python25\lib\site-packages\bzrlib\commands.py", line 853, in ignore_pipe
    result = func(*args, **kwargs)
  File "C:\python25\lib\site-packages\bzrlib\builtins.py", line 2985, in run
    from bzrlib.version import show_version
  File "C:\python25\lib\site-packages\bzrlib\version.py", line 23, in <module>
    from bzrlib import (
  File "C:\python25\lib\site-packages\bzrlib\bzrdir.py", line 1998, in <module>
    class BzrDirMetaFormat1(BzrDirFormat):
  File "C:\python25\lib\site-packages\bzrlib\bzrdir.py", line 2009, in BzrDirMetaFormat1
    _lock_class = lockdir.LockDir
  File "C:\python25\lib\site-packages\bzrlib\lazy_import.py", line 106, in __getattribute__
    obj = _replace()
  File "C:\python25\lib\site-packages\bzrlib\lazy_import.py", line 89, in _replace
    obj = factory(self, scope, name)
  File "C:\python25\lib\site-packages\bzrlib\lazy_import.py", line 192, in _import
    module = __import__(module_python_path, scope, scope, [member])
  File "C:\python25\lib\site-packages\bzrlib\lockdir.py", line 109, in <module>
    from bzrlib import (
  File "C:\python25\lib\site-packages\bzrlib\lock.py", line 503, in <module>
    "We must have one of fcntl, pywin32, or ctypes available"
NotImplementedError: We must have one of fcntl, pywin32, or ctypes available to support OS locking.

bzr 1.12rc1 on python 2.5.2 (win32)
arguments: ['C:\\python25\\Scripts\\bzr', '--version']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

--
Windows Vista SP1 x64 Ultimate.
Python 2.5.2 x64.

Revision history for this message
Mark Hammond (mhammond) wrote :

The installer *is* correct, just its message isn't that helpful - you simply can't mix and match 32 and 64bit binaries. I'm not sure about ctypes, but there will never be a pywin32 64bit Python 2.5 build - only 2.6 and later. It is possible that Python 2.5.4 has ctypes enabled though - that might be worth checking. Alternatively, just install the 32bit version of Python 2.5 - it works just fine on a 64bit OS.

Revision history for this message
Martin Pool (mbp) wrote : Re: bzr installer requires 32-bit python on windows; unclear message

It seems like we should at least give a better message about why.

summary: - Installer fails on 64-bit Windows
+ bzr installer requires 32-bit python on windows
summary: - bzr installer requires 32-bit python on windows
+ bzr installer requires 32-bit python on windows; unclear message
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

See also bug 345998, where this problem was also hit, also asking that there should be a python2.6 installer.

summary: - bzr installer requires 32-bit python on windows; unclear message
+ bzr python-based installer requires 32-bit python on windows; unclear
+ message
Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

Hello, I reported the problem as part of https://bugs.launchpad.net/bzr/+bug/345998 in March.
The logic is quite simple: if one has a x64 Windows, he will naturally install a x64 Python. The fact that there is no python-based Windows bzr installer working in this case, is a problem: it forces people to uninstall their python x64 and install a python x86. Could you please give an update on the present bug?

Revision history for this message
Martin Pool (mbp) wrote :

Hi Guilhem,

OK, if Python x64 can't coexist with Python x86 that does make it more serious, because I can see that people might have other requirements for the 64-bit version.

So this bug would be solved if we also made binary builds against the 64-bit Python?

Changed in bzr:
importance: Low → Medium
Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

yes, I think so.

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

And until this is fixed, you might want to put a warning in http://bazaar-vcs.org/WindowsDownloads , so that users know that they should use a 32-bit Python for the Python-based installers. Otherwise they'll just lose time rediscovering this bug.

Martin Pool (mbp)
tags: added: mysql packaging win32
Revision history for this message
Martin Pool (mbp) wrote :

I've added a note to the windows download page pointing this out.

Our Windows build & packaging process is still somewhat manual so I think it would slow it down further to make 64-bit python builds of every release, especially if you consider that there are installers for 2.4, 2.5 and 2.6. However, perhaps it would at least be reasonable to make an installer for bzr 2.0.2 against python 2.6?

It would also help if someone who has a 64-bit python2.6 installed could re-test running bzr from source - if they get the same error quoted in the original message there may be some simpler way around it.

Revision history for this message
icey502 (icey502) wrote :

Hey guys,

I have an AMD 64 bit Windoze machine and I am seeing this error. It does indeed seem to prevent me from exploring the wonders of Bazaar. I'm willing to run the build from source and post the error if that would help - but I'm a python-newbie so you might have to lay some instructions on me ;-)

Regards,

icey502

Revision history for this message
ANelson (anelson) wrote :

I'm impacted by this bug as well, as the 32-bit binaries shipped with the Bzr installer run out of memory when migrating my huge SVN repos with 50k files, ~24k revisions, and ~25GB of data.

I tried building bzr from source on 64-bit Python 2.6, but the missing zlib header files tripped me up. In case anyone's interested this is the error I got after doing a 'python setup.py build':

bzrlib/_chk_map_pyx.c(32) : fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory

  Cannot build extension "bzrlib._chk_map_pyx".
  Use "build_ext --allow-python-fallback" to use slower python implementations instead.

At any rate, I don't think it's realistic to count the build from source option as a viable workaround, at least not as of now.

Incidentally, I had almost the exact same problem trying to migrate this repos to Mercurial. It really sucks as it's preventing me from migrating our team away from SVN

Revision history for this message
Martin Pool (mbp) wrote :

Apparently python2.6 can now do 32<->64 bit cross-compiles on Windows.

Changed in bzr-windows-installers:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Martin Pool (mbp) wrote :
Revision history for this message
Kirill Suzev (suzev-kirill) wrote :

I ran into the same problem on Win7, 64-bit.
Maybe a better solution is to ship 64-bit binaries? That would solve the problem.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 331342] Re: bzr python-based installer requires 32-bit python on windows; unclear message

We're working on making a separate 64-bit Windows build.

Revision history for this message
Kirill Suzev (suzev-kirill) wrote :

Can you give any estimates about when 64-bit installer for Windows will be available?

Revision history for this message
Greg (gregspecialsource) wrote :

A 64bit Windows build would be a temporary work around for large files would it not?
I would love to see this sooner if possible. At present, Bazaar seems to need memory for at least 3x copies of the working data, so the largest file a Windows user can commit is somewhere between 650mb -> 1gb.

Revision history for this message
Dirk Räder (db6edr) wrote :

Any updates on this issue? Especially @mbp?

Would it help to compile Bazaar using IronPython, thus creating a .NET executable? As .NET executables can be compiled to target both x86 and x64 CPUs, this would probably also tackle https://bugs.launchpad.net/bzr/+bug/193685 at least for x64 Windows (out of memory exceptions on Windows machines)

Revision history for this message
Rene Leonhardt (rele) wrote :

It's a shame that there is still no Windows 64-bit build.

Are there any helpful hints to build with mingw?
I got not very far with mingw64, the ld error messages are no help at all.

Or is it possible to build with LLVM/Clang 3.0?

Revision history for this message
Nathan Osman (george-edison55) wrote :

I am pleased to announce that I have successfully built a 64-bit version of Bazaar for Python 2.7. You can get the Python installer and MSI files here:

http://www.box.com/s/5e7eca3684ad9f61315d

Basically the process for doing this was as follows:

1. Install the Windows 7.1 SDK.
2. Install Microsoft Visual C++ Express 2008 (NOT 2010 - because none of the official Python builds use it).
3. Download the Bazaar source code.
4. Follow the instructions here: http://mattptr.net/2010/07/28/building-python-extensions-in-a-modern-windows-environment/
5. Run 'python setup.py bdist_wininst' to generate the installer.

Revision history for this message
Thomas B (tekktura) wrote :

I was able to install v2.5.1 with Qt interface on python 2.7 (64bit) using a bit longer route with unofficial binary packages. These are available for example from: http://www.lfd.uci.edu/~gohlke/pythonlibs/
My setup as almost according to http://wiki.bazaar.canonical.com/WindowsInstall. This is what I've used:
- pywin32-218.win-amd64-py2.7.‌exe
- curl-7.23.1-win64-ssl-sspi.zip (from http://curl.haxx.se/download)
- pycurl-7.19.0.win-amd64-py2.7.‌exe
- pycrypto-2.6.win-amd64-py2.7.exe (from http://www.voidspace.org.uk/downloads/pycrypto26)
- zlib127-dll.zip (from http://zlib.net)
- paramiko-1.7.7.1.zip (setup from source: http://www.lag.net/paramiko/download)
- PyQt-Py2.7-x64-gpl-4.9.6-1.‌exe (Qt GPL included + tools)
- bzr-2.5.1.win-amd64-py2.7.‌exe
- bzrtools-2.3.0.tar.gz (launchpad)
- qbzr-0.23.0.tar.gz (launchpad, setup from source)

Also I needed to correct c:\Python27\Scripts\bzr.bat to yield something like:
@C:\Python27\python.exe C:\Python27\Scripts\bzr %*

After all these steps 'bzr explorer' should launch.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.