Problems with Python 2.7 + wxPython 2.8.11? Should I switch back to Python 2.6.5 + wx.Python 2.8.10.1?

0

I'm currently using Python 2.7 + wxPython 2.8.11 on my windows machine. While trying to build a small project (which also uses comtypes and lets say any activex such as flashwindow) I'm getting the following error:

>>>"c:\Program Files\Python_2.7\python.exe" setup.py py2exe
running py2exe
*** searching for required modules ***
*** parsing results ***
*** finding dlls needed ***
error: MSVCP90.dll: No such file or directory

I fixed it by copying the .dll and .manifest file to the directory. It builds fine. But again at the time of execution I got the errors like 'CreateActCtx' failed with error 0x0000007b followed by

File "zipextimporter.pyo", line 82, in load_module
File "wx\lib\flashwin.pyo", line 15, in 
File "zipextimporter.pyo", line 82, in load_module
File "wx\lib\activex.pyo", line 44, in <module>
ImportError: cannot import name myole4ax 

So, I upgraded my wxPython to 2.9* (Python 2.7) where is fails with unable to find PROCESS_START. So, I had to revert back to 2.8.11 (with Python 2.7) Now, it fails with the following (after copying the MSVC*90.dll to local directory and after building into a single executable):

C:\testflv> testflv.exe
Traceback (most recent call last):
  File "testflv.py", line 10, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "wx\__init__.pyo", line 45, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "wx\_core.pyo", line 4, in <module>
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading wx\_core_.pyd

It seems that there's a problem with myole4ax* as mention here (http://comments.gmane.org/gmane.comp.python.wxpython.devel/3114):

> Looks like the installer on windows does not include
> wx/lib/myole4ax.tlb and the brand new comtypes based ActiveX stuff
> does not work.
> After getting the missing stuff from SVN import errors go away.

Oops.  Sorry about that.  For the record here is the link to get the file.

http://trac.wxwidgets.org/browser/wxPython/branches/WX_2_8_BRANCH/wx/lib/myole4ax.tlb

How can I resolve the problem or do I need to switch back to the older versions? I'm stuck. Any help in this regards would be highly appreciated.

Thanks.

python
wxpython
py2exe
comtypes
asked on Stack Overflow Nov 17, 2010 by Humble Learner

1 Answer

0

I've tried the older version too but not of much help but it helped making things clear to me. While trying to bundle the things in executable I got this warning/error/message:

*** copy extensions ***
*** copy dlls ***
copying C:\Program Files\Python_2.6.5\w9xpopen.exe -> c:\wxpython\test\dist
copying C:\Program Files\Python_2.6.5\lib\site-packages\py2exe\run.exe -> c:\wxpython\test\dist\testactivex.exe
Adding python26.dll as resource to c:\wxpython\test\dist\testactivex.exe
The following modules appear to be missing
['comtypes.gen']

So, that's why when we execute the executable it failed with the following error:

c:\wxpython\test\dist>testactivex.exe
10:13:16: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x0000007b (the filename, directory name, or volume label syntax is incorrect.).
Traceback (most recent call last):
  File "testactivex.py", line 24, in <module>
ImportError: cannot import name myole4ax

But when we execute using

python.exe testactivex.py

It works fine. I have tried to dig more into it and I found some interesting links as follows:

  1. http://markmail.org/message/btbsrqhvfvyclfgo#query:+page:1+mid:btbsrqhvfvyclfgo+state:results

  2. http://translate.google.com/translate?hl=en&sl=ja&u=http://blog.loadlimits.info/2010/01/py2exewxpython%25E3%2581%25A7myole4ax%25E3%2581%258C%25E8%25A6%258B%25E3%2581%25A4%25E3%2581%258B%25E3%2582%2589%25E3%2581%25AA%25E3%2581%2584%25E3%2581%25A8%25E8%25A8%2580%25E3%2582%258F%25E3%2582%258C%25E3%2582%258B%25E5%2595%258F%25E9%25A1%258C/&ei=T3DlTNmwNIeqsAOe_JWxCw&sa=X&oi=translate&ct=result&resnum=6&ved=0CDUQ7gEwBQ&prev=/search%3Fq%3DImportError:%2Bcannot%2Bimport%2Bname%2Bmyole4ax%26hl%3Den%26rlz%3D1R2ADRA_enUS387%26prmd%3Div


Although I got an idea about the problem but I am not able to find the way how to resolve the myole4ax and comtypes.gen problem. If any of you guys know how to done packaging with this or create exe without any problem please please let me know.

ImportError: cannot import name myole4ax 

myole4ax and comtypes.gen problem was because it din't have sufficient privileges. Compiled from commandline in administrator mode and problem got resolved.

Thanks a lot!

answered on Stack Overflow Nov 18, 2010 by Humble Learner • edited Nov 29, 2010 by Chris Morgan

User contributions licensed under CC BY-SA 3.0