Bazaar problems with PyImport

Sandy Dunlop sandy.dunlop at gmail.com
Sun Apr 13 11:58:26 BST 2008


Hi Alexander,
That worked perfectly. I had a look at Bazaar's setup.py to figure  
out how to get the correct list of modules for PyInstaller to include.

This has allowed me to put together a Windows installer for Wildcat- 
BZR with everything included so that users don't have to install  
Python or Bazaar separately (which was one of the factors putting  
people off when I suggested using Bazaar in the office):

<http://sorn.net/blog/2008/04/Windows-Installer-for-Wildcat-BZR>

Thanks,
Sandy

On 12 Apr 2008, at 18:30, Sandy Dunlop wrote:
>
> Okay, thanks. I will give that a try and see how it goes.
>
> On 12 Apr 2008, at 18:23, Alexander Belchenko wrote:
>
>> Neither py2exe nor PyInstaller don't understand our lazy_import  
>> mechanics.
>> In our py2exe setup.py script we explicitly list all modules and  
>> packages that
>> should be in the resulted bzr.exe.
>>
>> I think you need to do something similar with PyInstaller.
>>
>> Sandy Dunlop пишет:
>>> Hi,
>>> I'm trying to get an application that uses bzrlib to be turned
>>> into a Windows executable using PyInstaller [1]. At the moment,
>>> my test script simply imports WorkingTree:
>>>   from bzrlib.workingtree import WorkingTree
>>> When I run PyInstaller on it, it produces a folder with the .exe
>>> file and a bunch of DLLs and other files that it depends on.
>>> When I tried to run it, I got this error:
>>> C:\pyinstaller-1.3\test\disttest>test.exe
>>> Traceback (most recent call last):
>>>   File "<string>", line 3, in <module>
>>>   File "C:\pyinstaller-1.3\iu.py", line 312, in importHook
>>>     mod = _self_doimport(nm, ctx, fqname)
>>>   File "C:\pyinstaller-1.3\iu.py", line 398, in doimport
>>>     exec co in mod.__dict__
>>>   File "test\buildtest\out1.pyz/bzrlib", line 94, in <module>
>>>   File "test\buildtest\out1.pyz/bzrlib.plugin", line 82, in  
>>> set_plugins_path
>>>   File "test\buildtest\out1.pyz/bzrlib.plugin", line 60, in  
>>> get_default_plugin_p
>>> ath
>>>   File "test\buildtest\out1.pyz/bzrlib.lazy_import", line 109, in  
>>> __getattribute
>>> __
>>> AttributeError: 'module' object has no attribute 'config_dir'
>>> I tried removing that call to config_dir from plugin.py, and now  
>>> I get this error:
>>> C:\pyinstaller-1.3\test\disttest>test.exe
>>> Traceback (most recent call last):
>>>   File "<string>", line 3, in <module>
>>>   File "C:\pyinstaller-1.3\iu.py", line 312, in importHook
>>>     mod = _self_doimport(nm, ctx, fqname)
>>>   File "C:\pyinstaller-1.3\iu.py", line 398, in doimport
>>>     exec co in mod.__dict__
>>>   File "test\buildtest\out1.pyz/bzrlib", line 94, in <module>
>>>   File "test\buildtest\out1.pyz/bzrlib.plugin", line 127, in  
>>> set_plugins_path
>>>   File "test\buildtest\out1.pyz/bzrlib.lazy_import", line 115, in  
>>> __setattr__
>>>   File "test\buildtest\out1.pyz/bzrlib.lazy_import", line 89, in  
>>> _replace
>>>   File "test\buildtest\out1.pyz/bzrlib.lazy_import", line 194, in  
>>> _import
>>> AttributeError: 'module' object has no attribute 'plugins'
>>> Does anyone here have any experience of PyInstaller, or any idea  
>>> why I'm getting all these runtime errors with lazy_import?
>>> Thanks,
>>> Sandy
>>
>


-- 
Sandy Dunlop
Consultant
Tel: +44 1355 233 804

Memex Technology Ltd.
Registered in Scotland		Company Number SC108095
Registered Office: 2Redwood Court, Peel Park, East Kilbride, G745PF

Confidentiality and Proprietary Rights Notice:
-----------------------------------------------
The information contained in this e-mail message, including any and all
attachments, is for the sole use of the intended recipient(s) and
contains information that Memex Technology Ltd. and Memex, Inc. consider
confidential and proprietary. If the reader of this message is not the
intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
document in error and that any review, dissemination, distribution, or
copying of this message is strictly prohibited. If you have received
this communication in error, please notify us immediately by e-mail, and
delete the original message.
Please consider the environment before printing this e-mail




-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20080413/92b25388/attachment-0001.htm 


More information about the bazaar mailing list