I was able to capture the error below when trying to enable the add-in.
Looks like write permissions in the win32com folder.  I changed
directory to the parent folder "C:\\Program
Files\\Python26\\lib\\site-packages\\win32com\\gen_py\\" and ran this:

 

C:\Program Files\Python26\Lib\site-packages> C:\Program
Files\Python26\Lib\site-packages

 

After this, I seem to have gotten past the write permissions, because I
see the dicts.dat file now, with the current date and time.

 

But now it just crashes Outlook.  I'm going to try to figure out what's
happening.  Any troubleshooting tips would be appreciated.  I'm a
developer, but haven't done Python in years, and have never done Outlook
add-ins.  For starters it would help to know what the entry point is
when Outlook tries to load the add-in.  In the Outlook add-in dialog it
shows that the add-in is pythoncom26.dll, but I don't see what script
it's executing.

 

Thanks,

Greg

 

 

pythoncom error: ERROR: server.policy could not create an instance.

 

Traceback (most recent call last):

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 136,
in CreateInstance

    return retObj._CreateInstance_(clsid, reqIID)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 194,
in _CreateInstance_

    myob = call_func(classSpec)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 727,
in call_func

    return resolve_func(spec)(*args)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 716,
in resolve_func

    module = _import_module(mname)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 735,
in _import_module

    __import__(mname)

  File "C:\spambayes-1.1a6\Outlook2000\addin.py", line 101, in <module>

    bForDemand=True, bValidateFile=bValidateGencache)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 393,
in EnsureModule

    module = GetModuleForTypelib(typelibCLSID, lcid, major, minor)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 262,
in GetModuleForTypelib

    AddModuleToCache(typelibCLSID, lcid, major, minor)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 575,
in AddModuleToCache

    _SaveDicts()

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 65,
in _SaveDicts

    f = open(os.path.join(GetGeneratePath(), "dicts.dat"), "wb")

IOError: [Errno 13] Permission denied: 'C:\\Program
Files\\Python26\\lib\\site-packages\\win32com\\gen_py\\dicts.dat'

pythoncom error: Unexpected gateway error

 

Traceback (most recent call last):

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 136,
in CreateInstance

    return retObj._CreateInstance_(clsid, reqIID)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 194,
in _CreateInstance_

    myob = call_func(classSpec)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 727,
in call_func

    return resolve_func(spec)(*args)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 716,
in resolve_func

    module = _import_module(mname)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\server\policy.py", line 735,
in _import_module

    __import__(mname)

  File "C:\spambayes-1.1a6\Outlook2000\addin.py", line 101, in <module>

    bForDemand=True, bValidateFile=bValidateGencache)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 393,
in EnsureModule

    module = GetModuleForTypelib(typelibCLSID, lcid, major, minor)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 262,
in GetModuleForTypelib

    AddModuleToCache(typelibCLSID, lcid, major, minor)

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 575,
in AddModuleToCache

    _SaveDicts()

  File "C:\Program
Files\Python26\lib\site-packages\win32com\client\gencache.py", line 65,
in _SaveDicts

    f = open(os.path.join(GetGeneratePath(), "dicts.dat"), "wb")

IOError: [Errno 13] Permission denied: 'C:\\Program
Files\\Python26\\lib\\site-packages\\win32com\\gen_py\\dicts.dat'

pythoncom error: CPyFactory::CreateInstance failed to create instance.
(80004005)

pythoncom error: ERROR: server.policy could not create an instance.

 

 

 

-----Original Message-----

From: Mark Hammond [mailto:[email protected]] 

Sent: Monday, June 07, 2010 6:22 PM

To: Greg Bahns

Cc: [email protected]

Subject: Re: [Spambayes] Win7 and Outlook 2010 64-bit

 

Nope - I'm on the 32bit version of Office - I wasn't aware a 64bit
version was available, and I don't have a licence anyway - I'm still
playing with a beta.  I should have noticed this when you mentioned the
64it versions of Python and related tools...

 

Good luck, and ping me if I can be of any help (although I am traveling
for the next week so may be slow to reply)

 

Mark

 

On 7/06/2010 11:39 PM, Greg Bahns wrote:

> Mi Mark,

> 

> Thanks for the reply.  I'll try playing with that later today.

> 

> Point of clarification: you mentioned that you're on Win7 x64.  I'm
also running Outlook 2010 x64.  Same for you?

> 

> Thanks,

> Greg

> 

> ________________________________

> 

> From: Mark Hammond [mailto:[email protected]]

> Sent: Mon 6/7/2010 2:49 AM

> To: Greg Bahns

> Cc: [email protected]

> Subject: Re: [Spambayes] Win7 and Outlook 2010 64-bit

> 

> 

> 

> I got a bit further with this and I've got things partially working.

> 

> 1) There seems to be an issue with how we detect if we are running as 

> a console for debugging purposes.  In the Outlook2000\addin.py file 

> there is a block:

> 

> try:

>       win32api.GetConsoleTitle()

> except win32api.error:

>       # No console - if we are running from Python sources,

>       # redirect to win32traceutil, but if running from a binary

> 

> This does *not* enter the exception handler as expected.  If you 

> modify that block so the exception block is always entered, you should


> get the logging back and should avoid an error caused by attempting to
'print'

> in a GUI program.

> 

> 2) After this things work for me, except that as with all versions of 

> SpamBayes, there is a problem filtering IMAP messages - and I didn't 

> get to test the POP behaviour.

> 

> Apart from that the spambayes manager and toolbar items all worked
fine.

>    This was on Windows 7 x64.

> 

> HTH,

> 

> Mark

> 

> On 6/06/2010 8:09 AM, Greg Bahns wrote:

>> According the posts I've seen in recent months, there's no sign that 

>> anyone has gotten SpamBayes to work with Outlook 2010 64-bit, so I'm 

>> giving it a try.

>> 

>> Here's what I've tried:

>> 

>> 1. Install 64-bit Python (http://www.python.org/download/)

>> 

>> a. Python 2.6.5 Windows X86-64 installer

>> 

>> 2. Install Distribute (http://pypi.python.org/pypi/distribute)

>> 

>> 3. Install 64-bit pywin32 

>> (http://sourceforge.net/projects/pywin32/files/)

>> 

>> a. pywin32-214.win-amd64-py2.6.exe

>> 

>> 4. Installed Spambayes from source

>> 

>> a. Download 1.1a6 source

>> 

>> b. Extracted to C:\spambayes-1.1a6

>> 

>> c. python setup.py install

>> 

>> d. It apparently installed to C:\Program 

>> Files\Python26\Lib\site-packages\spambayes-1.1a6-py2.6.egg

>> 

>> 5. permissions to write in spambayes Program Files folder

>> 

>> a. cd \Program 

>> Files\Python26\Lib\site-packages\spambayes-1.1a6-py2.6.egg

>> 

>> b. icacls spambayes /grant users:F /T

>> 

>> 6. Install Outlook add-in

>> 

>> a. Cd \spambayes-1.1a6\Outlook2000

>> 

>> b. Python addin.py

>> 

>> Everything appears to have executed successfully, but when I start 

>> Outlook and view the COM add-ins, SpamBayes is disabled. It says "Not


>> loaded. A runtime error occurred during the loading of the COM
Add-in."

>> 

>> I've looked for more details on the error in several places:

>> 

>> 1. C:\Users\greg\AppData\Roaming\SpamBayes

>> 

>> 2. C:\Users\greg\AppData\Local\SpamBayes

>> 

>> 3. NT Event Log

>> 

>> 4. Python Trace Collector in PythonWIn

>> 

>> I was really hopeful that useful troubleshooting info would appear in


>> PythonWin, but nothing, which makes me think Outlook is probably 

>> failing to load the Add-in at all. Any suggestions on what I can try
from here?

>> 

>> Thanks,

>> 

>> Greg

>> 

>> 

>> 

>> _______________________________________________

>> [email protected]

>> http://mail.python.org/mailman/listinfo/spambayes

>> Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes

>> Check the FAQ before asking: http://spambayes.sf.net/faq.html

> 

> 

> 

> 

 

 

_______________________________________________
[email protected]
http://mail.python.org/mailman/listinfo/spambayes
Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes
Check the FAQ before asking: http://spambayes.sf.net/faq.html

Reply via email to