Integrating with Bazaar on Windows

Alexander Belchenko bialix at ukr.net
Fri Apr 30 06:43:46 BST 2010


Gordon Tyler пишет:
> On 4/29/2010 5:30 PM, John Arbash Meinel wrote:
>> Gary van der Merwe wrote:
>>> On Thu, Apr 29, 2010 at 10:29 PM, Adam Glauser <adamglauser at gmail.com> wrote:
>>>> I've installed Bazaar 2.1.1 using the Windows .exe installer.  Python can't
>>>> find the bzrlib module when I do `from bzrlib import workingtree`.
>>>>  C:\Program Files\Bazaar\lib is in the PYTHONPATH.
>>>>
>>>> Is this expected?  What would be my next step to get Python to import from
>>>> bzrlib?
>>> I don't have access to a Windows machine right now, so I can't check,
>>> but I recall being able to adding C:\Program File\Bazaar\Libary.zip to
>>> your python path.
>> I would guess you would need to add a little bit more than that, to get
>> the dlls, etc into your path. But it may be 'lib' + 'library.zip' is enough.
> 
> set BZR_HOME=C:\Program Files (x86)\Bazaar
> set PYTHONPATH=%BZR_HOME%\lib;%BZR_HOME%\lib\Library.zip

Actually library.zip, no capital L there.

> 
> C:\>C:\Python25\python.exe
> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import bzrlib
>>>> bzrlib.version_info
> (2, 1, 1, 'final', 0)
> 
> Note that it does not work with Python 2.6. It fails to find the modules
> in the zip file, which is apparently due to "C:\Program Files
> (x86)\Bazaar\lib\library.zip\os.pyo has bad magic" that I am assuming
> means that the optimized bytecode form is incompatible between 2.5 and 2.6.

Any python bytecode (both pyc and pyo) is incompatible between different major versions of Python 
(2.5 vs 2.6, 2.4 vs 2.5 and so on).




More information about the bazaar mailing list