Mark,

to me this seems bizar
I have a different behaviour when I work in a pure vbscript or work in vba.
the vbs code doesn't work, while the vba code does work. Any idea, why there is a difference?

'vbs
'-----
Sub Test()
 Set interpreter = CreateObject("Python.Interpreter")
 interpreter.exec ("import pandas as pd")
 interpreter.exec ("df = pd.DataFrame([10,10])")
 Debug.Writeline interpreter.eval("df.to_string()")
End Sub
Call Test()

Output:
Python COM Server Internal Error (4, 3) : Unexpected Python Error: Traceback (most recent call last): File "C:\Python27\lib\site-packages\win32com\server\policy.py", line 324, in _InvokeEx_ return self._invokeex_(dispid, lcid, wFlags, args, kwargs, serviceProvider) File "C:\Python27\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_
   return func(*args)
File "C:\Python27\lib\site-packages\win32com\servers\interp.py", line 44, in Exec
   exec str(exp) in self.dict
 File "<string>", line 1, in <module>
File "C:\Python27\lib\site-packages\pandas-0.7.0-py2.7-win32.egg\pandas\__init__.py", line 10, in <module>
   import pandas._tseries as lib
ImportError: DLL load failed: The specified module could not be found.

'vba
'----
Sub Test()
 Set interpreter = CreateObject("Python.Interpreter")
 interpreter.exec ("import pandas as pd")
 interpreter.exec ("df = pd.DataFrame([10,10])")
 Debug.Print interpreter.eval("df.to_string()")
End Sub
Sub Main()
 call Test()
End Sub



--------------------------------------------------
From: "Mark Hammond" <mhamm...@skippinet.com.au>
Sent: Monday, February 20, 2012 11:24 PM
To: "Luc Kesters" <luc.kest...@hotmail.com>
Cc: <python-win32@python.org>
Subject: Re: [python-win32] [ANN] pywin32 build 217 released.

On 21/02/2012 9:05 AM, Luc Kesters wrote:
Hello Mark,

I installed the new pywin32. I don't have a problem with pywin32 itself.
But when importing other packages (the ones I mentioned) I still have
the problem (see below)
When I read the issues (see first message) it seemed to me a python
problem and not a pywin32 problem. If I understand your answer correct,
this isn't the case?
I should go back to the developers of the packages (I must say that the
"manifest" issue, is somewhat too technical for me)

Yeah - it appears that the package providing the "tables" module simply needs to be rebuilt with a new Python 2.7 - sadly it seems the fix didn't make it into 2.7.2, which is the current version, so it really needs to be built with a 2.7 built from mercurial.

Mark


Luc

[Error]
Message="Syntax error in script"
Number=44804
[Error Context]
Error_Description_1="Traceback (most recent call last):"
Error_Description_2=" File ""<Script Block >"", line 24, in <module>"
Error_Description_3=" import tables as tb"
Error_Description_4=" File
""C:\Python27\lib\site-packages\tables\__init__.py"", line 63, in <module>"
Error_Description_5=" from tables.utilsExtension import
getPyTablesVersion, getHDF5Version"
Error_Description_6="ImportError: DLL load failed: The specified module
could not be found."
Error_Source="Python ActiveX Scripting Engine"
HResult=$80020009
PreProcessor_Source_LineNr=31
Script_Error_Column=-1
Script_Error_LineNr=24
Script_Error_Text="import tables as tb"
Win32errorMessage="Exception occurred"


[Error]
Message="Syntax error in script"
Number=44804
[Error Context]
Error_Description_1="Traceback (most recent call last):"
Error_Description_2=" File ""<Script Block >"", line 24, in <module>"
Error_Description_3=" import pandas"
Error_Description_4=" File
""C:\Python27\lib\site-packages\pandas-0.7.0-py2.7-win32.egg\pandas\__init__.py"",
line 10, in <module>"
Error_Description_5=" import pandas._tseries as lib"
Error_Description_6="ImportError: DLL load failed: The specified module
could not be found."
Error_Source="Python ActiveX Scripting Engine"
HResult=$80020009
PreProcessor_Source_LineNr=31
Script_Error_Column=-1
Script_Error_LineNr=24
Script_Error_Text="import pandas"
Win32errorMessage="Exception occurred"


--------------------------------------------------
From: "Mark Hammond" <skippy.hamm...@gmail.com>
Sent: Monday, February 20, 2012 12:36 AM
To: "luc.k" <luc.kest...@hotmail.com>
Cc: <python-win32@python.org>
Subject: Re: [python-win32] [ANN] pywin32 build 217 released.

On 20/02/2012 5:10 AM, luc.k wrote:
Hi Marc,
I recently encounterd some problems with pyTables en Pandas. (certain
pyd
files generated an "Import DLL...."problem) After some research i came
accross the folowing issues
- http://bugs.python.org/issue4120
- http://bugs.python.org/issue7833 and
It's unclear to me how this will be solved. Maybe you can shed some
light?

Both those issues have had fixed checked in and the new pywin32 has
been built with those changes. The end result should be that (almost)
none of the .pyd files in pywin32 have a manifest, while
pythoncomloaderxx.dll does have a manifest to enable COM objects to be
loaded.

Are you having the problems with pywin32 extensions or others? If
others, then the only solution is probably to have those other
extensions rebuilt.

Mark



_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to