Discussion:
[python-win32] Error R6034 when I import uuid
Blair Hall
2014-10-17 01:47:51 UTC
Permalink
I have a small python COM server that worked fine with Excel until I
decided to import the standard Python 'uuid' module.

Now I get the Windows Runtime error R6034 "An application has made an
attempt to load the C runtime library incorrectly"

I there anything that I can do to fix this?
Vernon D. Cole
2014-10-17 07:18:51 UTC
Permalink
Which version of Python are you running?
32 or 64 bit?
Which version of pywin32?
Which version of Windows?
Can you make a small test case that will demonstrate the error?
Post by Blair Hall
I have a small python COM server that worked fine with Excel until I
decided to import the standard Python 'uuid' module.
Now I get the Windows Runtime error R6034 "An application has made an
attempt to load the C runtime library incorrectly"
I there anything that I can do to fix this?
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
Blair Hall
2014-10-18 00:24:05 UTC
Permalink
OK, sorry, here are some more details.

I have Python 2.7.8, win32, running on a Windows7 64-bit home machine (not
professional).

Here is my python script:

#---------------------------------------
import pythoncom

#import uuid

class Bug:

_reg_clsid_ = '{E3D5F332-F080-47B3-A319-A3A0E287E466}'
_reg_progid_ = "BugServer"
_public_methods_ = ['hello']

def __init__(self):
pass

#------------------------------------------------------------------------
def hello(self,who):
return "Hello {}".format(who)

#============================================================================
if __name__=='__main__':

# cmd options: --register --debug and --unregister
import win32com.server.register
win32com.server.register.UseCommandLine(Bug)
#---------------------------------------------


As it is, this works fine. I just run the script with an Admin command
window to register the server. But when I uncomment the 'import uuid' line
the error occurs as Excel opens.

In my VBA code I have (in ThisWorkbook)

Private Sub Workbook_Open()
' When the workbook opens we create the object
Set Bug = CreateObject("BugServer")
Debug.Print "open"
End Sub

and in a separate module I have defined the UDF

Public Bug As Object
Function hello(ByVal expr As String) As Variant
'
'
hello = Bug.hello(expr)

End Function

Thanks for the help.
Post by Vernon D. Cole
Which version of Python are you running?
32 or 64 bit?
Which version of pywin32?
Which version of Windows?
Can you make a small test case that will demonstrate the error?
Post by Blair Hall
I have a small python COM server that worked fine with Excel until I
decided to import the standard Python 'uuid' module.
Now I get the Windows Runtime error R6034 "An application has made an
attempt to load the C runtime library incorrectly"
I there anything that I can do to fix this?
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
mc@mclaveau
2014-10-19 21:14:13 UTC
Permalink
Hi!

I test with my own Python-COM-server (Ponx), and I have also an error:

---------------------------------------------------------------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: D:\Dev\Python\PonxTest101.exe

R6034

An application has made an attempt to load the C runtime library
incorrectly.
Please contact the application's support team for more information.
---------------------------------------------------------------------------------


I use Python 2.7.3 and Pywin32.218 on Win-7-64 bits.
If I comment the line, like: #import uuid the problem
disappears

@-salutations
--
Michel Claveau
Post by Blair Hall
OK, sorry, here are some more details.
I have Python 2.7.8, win32, running on a Windows7 64-bit home machine
(not professional).
#---------------------------------------
import pythoncom
#import uuid
_reg_clsid_ = '{E3D5F332-F080-47B3-A319-A3A0E287E466}'
_reg_progid_ = "BugServer"
_public_methods_ = ['hello']
pass
#------------------------------------------------------------------------
return "Hello {}".format(who)
#============================================================================
# cmd options: --register --debug and --unregister
import win32com.server.register
win32com.server.register.UseCommandLine(Bug)
#---------------------------------------------
As it is, this works fine. I just run the script with an Admin command
window to register the server. But when I uncomment the 'import uuid'
line the error occurs as Excel opens.
In my VBA code I have (in ThisWorkbook)
Private Sub Workbook_Open()
' When the workbook opens we create the object
Set Bug = CreateObject("BugServer")
Debug.Print "open"
End Sub
and in a separate module I have defined the UDF
Public Bug As Object
Function hello(ByVal expr As String) As Variant
'
'
hello = Bug.hello(expr)
End Function
Thanks for the help.
Which version of Python are you running?
32 or 64 bit?
Which version of pywin32?
Which version of Windows?
Can you make a small test case that will demonstrate the error?
I have a small python COM server that worked fine with Excel
until I decided to import the standard Python 'uuid' module.
Now I get the Windows Runtime error R6034 "An application has
made an attempt to load the C runtime library incorrectly"
I there anything that I can do to fix this?
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
--
Blair Hall
2014-10-21 20:24:35 UTC
Permalink
I have just tried this same project on a computer with Win7-64 Professional
and MS Office 2010 (but with the same 2.7.8 32-bit Python installation).

The error does NOT occur.

So, is it the difference between Win7 for Home users and professional, or
is it something to do with MS Office (the bug occurred with MS Office 2007
on Win7-64 Home edition)?
Post by Blair Hall
OK, sorry, here are some more details.
I have Python 2.7.8, win32, running on a Windows7 64-bit home machine (not
professional).
#---------------------------------------
import pythoncom
#import uuid
_reg_clsid_ = '{E3D5F332-F080-47B3-A319-A3A0E287E466}'
_reg_progid_ = "BugServer"
_public_methods_ = ['hello']
pass
#------------------------------------------------------------------------
return "Hello {}".format(who)
#============================================================================
# cmd options: --register --debug and --unregister
import win32com.server.register
win32com.server.register.UseCommandLine(Bug)
#---------------------------------------------
As it is, this works fine. I just run the script with an Admin command
window to register the server. But when I uncomment the 'import uuid' line
the error occurs as Excel opens.
In my VBA code I have (in ThisWorkbook)
Private Sub Workbook_Open()
' When the workbook opens we create the object
Set Bug = CreateObject("BugServer")
Debug.Print "open"
End Sub
and in a separate module I have defined the UDF
Public Bug As Object
Function hello(ByVal expr As String) As Variant
'
'
hello = Bug.hello(expr)
End Function
Thanks for the help.
Post by Vernon D. Cole
Which version of Python are you running?
32 or 64 bit?
Which version of pywin32?
Which version of Windows?
Can you make a small test case that will demonstrate the error?
Post by Blair Hall
I have a small python COM server that worked fine with Excel until I
decided to import the standard Python 'uuid' module.
Now I get the Windows Runtime error R6034 "An application has made an
attempt to load the C runtime library incorrectly"
I there anything that I can do to fix this?
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
Roger Upole
2014-11-05 20:37:51 UTC
Permalink
This appears to be due to way rpcrt4.dll is loaded by ctypes. If a side-by-side assembly has already loaded a version that’s not
compatible with the activation context of Python itself, ctypes will attempt to use it anyway.

Roger

"Blair Hall" <***@gmail.com> wrote in message news:CAJeTVArsN8Vp_e6cnF3yUf6cUC4uHUJ6ggmsKUeDCzcKA_=***@mail.gmail.com...
I have a small python COM server that worked fine with Excel until I decided to import the standard Python 'uuid' module.

Now I get the Windows Runtime error R6034 "An application has made an attempt to load the C runtime library incorrectly"


I there anything that I can do to fix this?



--------------------------------------------------------------------------------
Loading...