From reckoner at gmail.com Wed Apr 1 00:17:58 2015 From: reckoner at gmail.com (reckoner) Date: Tue, 31 Mar 2015 15:17:58 -0700 Subject: [python-win32] getting Windows key codes Message-ID: <551B1D16.1020407@gmail.com> The easiest thing to do is follow the instructions here: http://ahkscript.org/docs/KeyList.htm#SpecialKeys And use the keyboard hook to report the keystrokes. Then, you can use https://github.com/t4ngo/dragonfly To do all the key re-mapping. by the way, the dragonfly source code has all the ctypes calls to interact with the keyboard. Just about every key and key combination you can think of is in there. I hope that helps. From shrivastavkhyati at gmail.com Tue Apr 7 17:51:00 2015 From: shrivastavkhyati at gmail.com (Khyati Shrivastava) Date: Tue, 7 Apr 2015 11:51:00 -0400 Subject: [python-win32] Python library - WMI.py RegistryValueChangeEvent Message-ID: I have a question about RegistryValueChangeEvent that I have not been able to find an answer to on the internet so far. I would appreciate any help since I have already spent a lot of time finding any material that explains this: *What I am trying to do: * - create an event when a value for a registry key changes *How I am doing it: * import wmi import _winreg c = wmi.WMI () raw_wql = "SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE' AND KeyPath='Software\\\\Temp' AND ValueName='Name'" watcher = c.watch_for(raw_wql=raw_wql,wmi_class = "__ExtrinsicEvent") while True: try: process_created = watcher() print 'value changed' Event is caught perfectly but *Problem: * traceback (most recent call last): File "MonitorRegistry.py", line 18, in process_created = watcher() File "C:\Python27\lib\site-packages\wmi.py", line 1195, in __call__ handle_com_error () File "C:\Python27\lib\site-packages\wmi.py", line 241, in handle_com_error raise klass (com_error=err) _wmi: *when I debugged, this is the module that throws the exception: * *wmi.py [Line 1178-1195] * def __call__ (self, timeout_ms=-1): """When called, return the instance which caused the event. Supports timeout in milliseconds (defaulting to infinite). If the watcher times out, :exc:`x_wmi_timed_out` is raised. This makes it easy to support watching for multiple objects. """ try: event = self.wmi_event.NextEvent (timeout_ms) if self.is_extrinsic: return _wmi_event (event, None, self.fields) else: return _wmi_event ( *event.Properties_ ("TargetInstance").*Value, _wmi_object (event, property_map=self._event_property_map), self.fields ) except pywintypes.com_error: handle_com_error () *self.is_extrinsic returns false and event.Properties_("TargetInstance").Value throws the exception* Is there a way I can explicitly initialize the class _wmi_watcher and set self.is_extrinsic = True? Other information: Running on Windows 8 64 Bit >>> platform.machine() 'AMD64' >>> platform.architecture() ('64bit', 'WindowsPE') >>> platform.python_version() '2.7.8' >>> platform.python_implementation() 'CPython' Using WMI-1.4.9.win32 - downloaded via PIP pywin32-219.win-amd64-py2.7 Thanks khyati -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Fri Apr 10 22:16:18 2015 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 10 Apr 2015 21:16:18 +0100 Subject: [python-win32] Oldest Python version for pywin32? Message-ID: <55282F92.6020309@timgolden.me.uk> Really addressed to Mark / Roger, but in case anyone else wants to chip in anyway.. What's the oldest Python version still supported by pywin32? I ask because I'm slightly tweaking the [somewhat gnarly] hunt-the-SDK code in setup.py, and I don't want to introduce something which won't build on an older version. FWIW the changes I'm talking about are here: https://bitbucket.org/TJG/pywin32/commits/227e8c794af76512832e5f79f8544c4a1e96915b TJG From blairdhall at gmail.com Wed Apr 15 03:26:38 2015 From: blairdhall at gmail.com (Blair Hall) Date: Wed, 15 Apr 2015 13:26:38 +1200 Subject: [python-win32] python-win32 Digest, Vol 140, Issue 1 In-Reply-To: References: Message-ID: I am still stuck on this problem. I have posted a more detailed account here http://stackoverflow.com/questions/29597999/incorrect-dll-is-loaded-from-windows-path-instead-of-manifest _ctypes.pyd calls LoadLibraryA("msvcr90.dll") and a version of msvcr90.dll is found in the Windows PATH, despite the fact that I have included the correct version and a manifest, as described on the internet in may places. Is there is something wrong with the way that I have created my DLL? As far as I can see, the only place that msvcr90.dll is loaded during the registration process is the one one shown on the link above. If I remove the path pointing to the wrong DLL, then the LoadLibrary call still seems to fail, it does not succeed in loading the copy of msvcr.dll that I supply, but that failure does not cause the registration of my DLL to fail (indeed, the error dialog that pops up when the wrong msvcr90.dll is loaded can just be canceled: the COM server then registers and operates correctly). This behaviour suggests to me that the manifest I supply when distributing the DLL is not being used correctly. Can no one offer any help? On Fri, Nov 7, 2014 at 12:00 AM, wrote: > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Re: Error R6034 when I import uuid (Roger Upole) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 5 Nov 2014 15:37:51 -0500 > From: "Roger Upole" > To: python-win32 at python.org > Subject: Re: [python-win32] Error R6034 when I import uuid > Message-ID: > Content-Type: text/plain; charset="utf-8" > > 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" wrote in message > news:CAJeTVArsN8Vp_e6cnF3yUf6cUC4uHUJ6ggmsKUeDCzcKA_=uKw at 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? > > > > > -------------------------------------------------------------------------------- > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/python-win32/attachments/20141105/9bf7f239/attachment-0001.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > > ------------------------------ > > End of python-win32 Digest, Vol 140, Issue 1 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Wed Apr 15 11:11:26 2015 From: skippy.hammond at gmail.com (Mark Hammond) Date: Wed, 15 Apr 2015 19:11:26 +1000 Subject: [python-win32] Oldest Python version for pywin32? In-Reply-To: <55282F92.6020309@timgolden.me.uk> References: <55282F92.6020309@timgolden.me.uk> Message-ID: <552E2B3E.5000303@gmail.com> Hi Tim, I still build for 2.5 and 3.1, but really only because they do still build. If there's a reasonable reason to drop support for some I doubt it will hurt many people - the sourceforge page should show you download stats, but last I looked 2.5 was rarely used then, and that was some time ago! FTR, last time I built I used 6.0 of the SDK for 2.5 and 7.1 for the rest. Dropping 2.5 for the next build sounds OK to me (and would probably happen anyway if I had to recreate the build environment from scratch - I don't think I'd bother hunting 6.0 down :) Cheers, Mark On 11/04/2015 6:16 AM, Tim Golden wrote: > Really addressed to Mark / Roger, but in case anyone else wants to chip > in anyway.. > > What's the oldest Python version still supported by pywin32? I ask > because I'm slightly tweaking the [somewhat gnarly] hunt-the-SDK code in > setup.py, and I don't want to introduce something which won't build on > an older version. > > FWIW the changes I'm talking about are here: > > https://bitbucket.org/TJG/pywin32/commits/227e8c794af76512832e5f79f8544c4a1e96915b > > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 From mail at timgolden.me.uk Wed Apr 15 12:25:46 2015 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 15 Apr 2015 11:25:46 +0100 Subject: [python-win32] Oldest Python version for pywin32? In-Reply-To: <552E2B3E.5000303@gmail.com> References: <55282F92.6020309@timgolden.me.uk> <552E2B3E.5000303@gmail.com> Message-ID: <552E3CAA.4010604@timgolden.me.uk> On 15/04/2015 10:11, Mark Hammond wrote: > Hi Tim, > I still build for 2.5 and 3.1, but really only because they do still > build. If there's a reasonable reason to drop support for some I doubt > it will hurt many people - the sourceforge page should show you download > stats, but last I looked 2.5 was rarely used then, and that was some > time ago! FWIW the sf page for build 219 shows less than 100 downloads for 2.5/6 and 3.1/2. Unsuprisingly 2.7 dominates with 3,000 downloads at 32-bit (2,000 at 64-bit). 3.3 comes in just over 100 and 3.4/5 each a few hundreds. So I feel no particular compunction about dropping forward support for 2.6 and lower and 3.2 and lower. (Could say 2.5/3.1 but it's the same SDK level I think). TJG From vernondcole at gmail.com Wed Apr 15 15:59:00 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Wed, 15 Apr 2015 07:59:00 -0600 Subject: [python-win32] Oldest Python version for pywin32? In-Reply-To: <552E3CAA.4010604@timgolden.me.uk> References: <55282F92.6020309@timgolden.me.uk> <552E2B3E.5000303@gmail.com> <552E3CAA.4010604@timgolden.me.uk> Message-ID: I concur. I am one of the 100 downloads of 2.5 -- and the only reason I download it is to test it, not to use it in production. How many of the other downloaders are like me? Most, I would bet. Dropping 2.5 would allow use of many Python3 features, since 2.6 has the backports for them (print function, "{}".format(), byte literals, and especially "except ... as"). It would simplify the Python code in the library. On Wed, Apr 15, 2015 at 4:25 AM, Tim Golden wrote: > On 15/04/2015 10:11, Mark Hammond wrote: > > Hi Tim, > > I still build for 2.5 and 3.1, but really only because they do still > > build. If there's a reasonable reason to drop support for some I doubt > > it will hurt many people - the sourceforge page should show you download > > stats, but last I looked 2.5 was rarely used then, and that was some > > time ago! > > > FWIW the sf page for build 219 shows less than 100 downloads for 2.5/6 > and 3.1/2. > > Unsuprisingly 2.7 dominates with 3,000 downloads at 32-bit (2,000 at > 64-bit). > > 3.3 comes in just over 100 and 3.4/5 each a few hundreds. > > So I feel no particular compunction about dropping forward support for > 2.6 and lower and 3.2 and lower. (Could say 2.5/3.1 but it's the same > SDK level I think). > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From accessnewbie at gmail.com Wed Apr 15 17:53:08 2015 From: accessnewbie at gmail.com (Access Newbie) Date: Wed, 15 Apr 2015 08:53:08 -0700 Subject: [python-win32] Transfer Access 2010 query results to python script for ArcGIS geoprocessing actions Message-ID: Is it possible to transfer the results of an Access 2010 query (accdb extension) to a python script with the click of a button? Information will be used as variables within the script. Prefer to click button from Access data entry form to execute script but it can be from another GUI if necessary. Data getting transferred (anywhere from 20-50 fields) will be contact information, shapefile name and directory location, and arcpy parameters such as buffer distances for various geoprocessing applications. Script can be run from the command line and does not require ArcMap to be open to run. I am not sure where to begin and am not really a programmer so the really complicated stuff will probably confuse me unless explained in easy to understand language. Thank you for any and all guidance -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Wed Apr 15 18:41:22 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Wed, 15 Apr 2015 10:41:22 -0600 Subject: [python-win32] Transfer Access 2010 query results to python script for ArcGIS geoprocessing actions In-Reply-To: References: Message-ID: You will probably need the help of an experienced Python programmer to do what you wish, but the tools are all available, and you came to the correct place to find them. [ -- almost -- Normally, adodbapi is included in pywin32, but Mark and I had a communications failure with the current release, so you will have to download from http://sourceforge.net/projects/adodbapi until the next pywin32 release.] The good news is that using the adodbapi module, you can read and write data from from an Access database using SQL, almost as if it were on a real database server -- and you do not need to have Access on your computer to do it. The bad news is that some Geoprocessing tools you may want for your application only work if you use the Python which is built in to ArcGis -- and it might be a bit tricky to install pywin32 in it -- since they install it in a non-standard location. The better news is that there are also third-party libraries of Geoprocessing tools for Python that can used outside of ArcGis that might do what you need, assuming that your Geographic database is served on a capable server like PostgreSQL (PostGIS) or Microsoft SQL Server (both of which are also supported by adodbapi.) Feel free to contact me offline if you want some references. -- Vernon Cole On Wed, Apr 15, 2015 at 9:53 AM, Access Newbie wrote: > Is it possible to transfer the results of an Access 2010 query (accdb > extension) to a python script with the click of a button? Information will > be used as variables within the script. > > Prefer to click button from Access data entry form to execute script but > it can be from another GUI if necessary. > > Data getting transferred (anywhere from 20-50 fields) will be contact > information, shapefile name and directory location, and arcpy parameters > such as buffer distances for various geoprocessing applications. Script can > be run from the command line and does not require ArcMap to be open to run. > > I am not sure where to begin and am not really a programmer so the really > complicated stuff will probably confuse me unless explained in easy to > understand language. > > Thank you for any and all guidance > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Apr 15 19:54:49 2015 From: timr at probo.com (Tim Roberts) Date: Wed, 15 Apr 2015 10:54:49 -0700 Subject: [python-win32] Transfer Access 2010 query results to python script for ArcGIS geoprocessing actions In-Reply-To: References: Message-ID: <552EA5E9.8020202@probo.com> Access Newbie wrote: > Is it possible to transfer the results of an Access 2010 query (accdb > extension) to a python script with the click of a button? Information > will be used as variables within the script. > > Prefer to click button from Access data entry form to execute script > but it can be from another GUI if necessary. > > Data getting transferred (anywhere from 20-50 fields) will be contact > information, shapefile name and directory location, and arcpy > parameters such as buffer distances for various geoprocessing > applications. Script can be run from the command line and does not > require ArcMap to be open to run. Well, wait a minute. You have described several completely different approaches here. Are you talking about something that runs inside of Access, or a GUI app that talks directly to the database, or a command-line app that pulls from the database? In order to display an Access form, the Access application has to be running. In that case, buttons can call Visual Basic scripts, and it may be easier to do what you want entirely in Visual Basic. There are several ways for a standalone application to talk to an Access database, assuming Access is installed. However, if Access already has the database open, you can't necessarily open it in another application at the same time. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Wed Apr 15 19:57:34 2015 From: timr at probo.com (Tim Roberts) Date: Wed, 15 Apr 2015 10:57:34 -0700 Subject: [python-win32] python-win32 Digest, Vol 140, Issue 1 In-Reply-To: References: Message-ID: <552EA68E.3080504@probo.com> Blair Hall wrote: > > _ctypes.pyd calls LoadLibraryA("msvcr90.dll") and a version of > msvcr90.dll is found in the Windows PATH, despite the fact that I have > included the correct version and a manifest, as described on the > internet in may places. > > Is there is something wrong with the way that I have created my DLL? I'm surprised at both of these actions. MSVCR90, from Visual Studio 2008, still uses the "side-by-side" loading mechanism. The operating system is supposed to look in the version-tagged side-by-side repository, not in the path nor in the local directory. Can you show us your manifest? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From carl.evans29 at gmail.com Wed Apr 15 19:56:56 2015 From: carl.evans29 at gmail.com (Carl Evans) Date: Wed, 15 Apr 2015 11:56:56 -0600 Subject: [python-win32] Win32com Error any suggestions? Message-ID: Hi, I am trying to dipatch excel using the win32com library but for some reason am running into an issue. I have the following code: import win32com.clientimport os file1= r'C:\\Users\cevans\Desktop\models1\file.xlsm' def refresher(): if os.path.exists(file1): xl = win32com.client.Dispatch("Excel.Application") xl.Workbooks.Open(Filename=file1,ReadOnly=1) xl.Visible = True xl.Application.Run('Report_Tablerefresh1') xl.Workbooks(1).Close(SaveChanges=1) xl.Application.Quit() del xl refresher() Which causes this error: Traceback (most recent call last): File "C:/Users/cevans/PycharmProjects/RigLocatorMapPull/Pipe_StorageRefresh.py", line 17, in refresher() File "C:/Users/cevans/PycharmProjects/RigLocatorMapPull/Pipe_StorageRefresh.py", l ine 10, in refresher xl = win32com.client.Dispatch("Excel.Application") File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserNamereturn (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 84, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2146959355, 'Server execution failed', None, None) I have tried several things to no avail, any suggestions? -- Carl E. Evans MSc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blairdhall at gmail.com Thu Apr 16 03:00:15 2015 From: blairdhall at gmail.com (Blair Hall) Date: Thu, 16 Apr 2015 13:00:15 +1200 Subject: [python-win32] python-win32 Digest, Vol 145, Issue 6 In-Reply-To: References: Message-ID: > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 15 Apr 2015 10:57:34 -0700 > From: Tim Roberts > To: python-win32 > Subject: Re: [python-win32] python-win32 Digest, Vol 140, Issue 1 > Message-ID: <552EA68E.3080504 at probo.com> > Content-Type: text/plain; charset="utf-8" > > Blair Hall wrote: > > > > _ctypes.pyd calls LoadLibraryA("msvcr90.dll") and a version of > > msvcr90.dll is found in the Windows PATH, despite the fact that I have > > included the correct version and a manifest, as described on the > > internet in may places. > > > > Is there is something wrong with the way that I have created my DLL? > > I'm surprised at both of these actions. MSVCR90, from Visual Studio > 2008, still uses the "side-by-side" loading mechanism. The operating > system is supposed to look in the version-tagged side-by-side > repository, not in the path nor in the local directory. > > Can you show us your manifest? > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > Thanks for taking a look. I have put the contents of the manifest file at the bottom of this post: http://stackoverflow.com/questions/29597999/incorrect-dll-is-loaded-from-windows-path-instead-of-manifest My understanding was that the operating system should look for the manifest, but, well, it doesn't seem to be doing that for me. :-( -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Thu Apr 16 19:02:40 2015 From: timr at probo.com (Tim Roberts) Date: Thu, 16 Apr 2015 10:02:40 -0700 Subject: [python-win32] Win32com Error any suggestions? In-Reply-To: References: Message-ID: <552FEB30.4090501@probo.com> Carl Evans wrote: > > I am trying to dipatch excel using the win32com library but for some > reason am running into an issue. I have the following code: The obvious question is, do you have Excel installed? That error (80080005) means that the COM server app (Excel, in this case) did not start up and register itself within the timeout period, which is usually a very long time -- 2 minutes. If you start Excel by hand, does it start right up? Is it possible you ran this on a machine that had a trial version, and the trial period had expired, or the app had never been run and its trying to install itself? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Thu Apr 16 19:13:09 2015 From: timr at probo.com (Tim Roberts) Date: Thu, 16 Apr 2015 10:13:09 -0700 Subject: [python-win32] python-win32 Digest, Vol 145, Issue 6 In-Reply-To: References: Message-ID: <552FEDA5.6030209@probo.com> You might consider double-checking your message subjects before responding. That's especially important when you read the digest. Blair Hall wrote: > > Can you show us your manifest? > > > Thanks for taking a look. > > I have put the contents of the manifest file at the bottom of this post: > > http://stackoverflow.com/questions/29597999/incorrect-dll-is-loaded-from-windows-path-instead-of-manifest > > My understanding was that the operating system should look for the > manifest, but, well, it doesn't seem to be doing that for me. :-( Well, here's the thing that makes this tricky. The manifest you showed is associated with the library, not with your DLL. It is telling the system which version of the CRT is included in your Microsoft.VC90.CRT folder. But unless you have a manifest associated with your application, there's nothing that tells the system to go look for that specific version. By default, it will go searching for the newest one. The side-by-side stuff is an abomination, which is why it was abandoned in Visual Studio 2010. One ugly alternative would be to edit sys.path in your code before you start your imports. If you remove everything but the Windows directories, that should solve the problem. However, EVEN IF it finds the wrong DLL, I don't understand why you would see a failure. If it found msvcr90.dll once, it should be able to find it again and again. That confuses me. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Thu Apr 16 20:46:01 2015 From: timr at probo.com (Tim Roberts) Date: Thu, 16 Apr 2015 11:46:01 -0700 Subject: [python-win32] Win32com Error any suggestions? In-Reply-To: References: <552FEB30.4090501@probo.com> Message-ID: <55300369.8010708@probo.com> Carl E. Evans wrote: > I can open excel fine with no issues. Its a full 64bit edition, so no > trial or anything. Also, when I run the script, this error occurs in > about 2 seconds, so not waiting for any sort of time out. Very odd. Has this EVER worked for you? You aren't trying to run this from a scheduled task or a service, are you? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Thu Apr 16 22:37:22 2015 From: timr at probo.com (Tim Roberts) Date: Thu, 16 Apr 2015 13:37:22 -0700 Subject: [python-win32] Win32com Error any suggestions? In-Reply-To: <65A5ADC1-6595-43E5-B556-9975A3E2A0CB@gmail.com> References: <552FEB30.4090501@probo.com> <55300369.8010708@probo.com> <65A5ADC1-6595-43E5-B556-9975A3E2A0CB@gmail.com> Message-ID: <55301D82.1050504@probo.com> Carl Evans wrote: > Yea I know. It worked fine when testing, I had it set up on task scheduler when it stopped working u expectedly. Aha! I should have asked that earlier. I can explain this. By default, processes running under Task Scheduler run as the LocalSystem user, not as the logged in user. The LocalSystem user doesn't have permission to access the applications you have installed, unless you installed it "for all users". It also can't access your net shares, in case that becomes necessary later.) Further, scheduled tasks by default run in "session 0", which does not have access to the desktop. So, you cannot run any GUI applications at all. Both of those things can be adjusted. You can change the user name in the Task Scheduler control panel applet, but to set "interactive mode", you have to do it when you create the task. > I am running 32bit Python 2.7 on 64bit excel if this makes a difference. I guess next test would be to try a reinstall of office? No, that's not the issue. The Office apps all run as "out of process" COM services, which means they run in their own process. Because of that, the 32/64 mismatch doesn't matter. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mc at mclaveau.com Fri Apr 17 08:08:12 2015 From: mc at mclaveau.com (mc@mclaveau) Date: Fri, 17 Apr 2015 08:08:12 +0200 Subject: [python-win32] Win32com Error any suggestions? In-Reply-To: <55301D82.1050504@probo.com> References: <552FEB30.4090501@probo.com> <55300369.8010708@probo.com> <65A5ADC1-6595-43E5-B556-9975A3E2A0CB@gmail.com> <55301D82.1050504@probo.com> Message-ID: <5530A34C.1030501@mclaveau.com> Hi! > Carl Evans wrote: >> I am running 32bit Python 2.7 on 64bit excel Warning! 64 bits Excel have not the same CLSID than 32 bits Excel. If it run in tests/dev. with 32 bits Excel, try to install a 32 bits Office on the production computer. MS himself advises to prefer the 32-bit version. @-salutations -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sign-styloplume.GIF Type: image/gif Size: 9129 bytes Desc: not available URL: From blairdhall at gmail.com Sun Apr 19 02:22:23 2015 From: blairdhall at gmail.com (Blair Hall) Date: Sun, 19 Apr 2015 12:22:23 +1200 Subject: [python-win32] Error R6034 when I import uuid Message-ID: > You might consider double-checking your message subjects before > responding. That's especially important when you read the digest. > Oh dear, I am sorry. I hadn't twigged to how that worked. I have restored the original subject now, from my initial post. Hope that helps. > Blair Hall wrote: > > > > Can you show us your manifest? > > > > > > Thanks for taking a look. > > > > I have put the contents of the manifest file at the bottom of this post: > > > > > http://stackoverflow.com/questions/29597999/incorrect-dll-is-loaded-from-windows-path-instead-of-manifest > > > > My understanding was that the operating system should look for the > > manifest, but, well, it doesn't seem to be doing that for me. :-( > > Well, here's the thing that makes this tricky. The manifest you showed > is associated with the library, not with your DLL. It is telling the > system which version of the CRT is included in your Microsoft.VC90.CRT > folder. But unless you have a manifest associated with your > application, there's nothing that tells the system to go look for that > specific version. By default, it will go searching for the newest one. > Just to be clear, I showed you the manifest that I have provided in my project, as recommended when distributing py2exe executables (see here: http://www.py2exe.org/index.cgi/Tutorial#Step521). Note too, that I have also tried the redistributable C runtime installer from Microsoft on the target machines, but that didn't change anything: if there is a version of msvcr90.dll in the Windows PATH, that gets used. The DLL itself has an embedded manifest (generated automatically by py2exe, with no help from me) I have now added that to the stackoverflow page, so you can see it. One ugly alternative would be to edit sys.path in your code before you > start your imports. If you remove everything but the Windows > directories, that should solve the problem. > I don't follow. Surely sys.path has nothing to do with it? It is the LoadLibrary("msvcr90") call from _cytpes.pyd that seems to be the problem here and that is not using the sys.path (or is it?). For what its worth, here are some more of my own thoughts. I have used py2exe on another project that creates an EXE. This project also imports uuid (it basically imports the same stuff I am using now, but for a different application). In that case, the manifest seems to work as expected. So, I wonder what is different in the case of my DLL? Well one thing that I can think of is that the problem arises when registering the DLL as a COM server, using regsvr32. Could it be that Windows does not know to look for the manifest in the right place because it is regsvr32 that is running?! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hartmut.niemann at siemens.com Mon Apr 20 15:49:58 2015 From: hartmut.niemann at siemens.com (Niemann, Hartmut) Date: Mon, 20 Apr 2015 13:49:58 +0000 Subject: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden Message-ID: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> Hello! I try to open and write an (Access 2000) mdb file, and get an error I cannot interpret. This code as worked in the past (two months ago) and works without modification on a different PC of a colleague, so chances are my configuration misses a simple thing, a software package (update) or something other trivial. My System is Win7, Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on win32, pywin32-219.win-amd64-py2.7.exe Microsoft Office Access 2007 (12.0.6696.1000) SP3 MSO (12.0.6718.5000) Could this be some 32-bit vs. 64-bit thing? (ATM I can not check whether my colleague still uses an older (32bit?) installation.) this is the source -------------------- try: print "Open ADOB.Connection" ado = win32com.client.Dispatch("ADODB.Connection") connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\"%s\"" % filename # Access 2003 #connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\"%s\"" % filename # Access 2007 print "Open ADOB.Connection with '%s'" % connectionstring ado.Open(connectionstring) except pythoncom.com_error, (hr, msg, exc, arg): # pylint: disable=E1101 print "The Access call failed with code %d: %s" % (hr, msg) if exc is None: print "There is no extended error information" else: wcode, source, text, helpFile, helpId, scode = exc print "The source of the error is", source print "The error message is", text print "More info can be found in %s (id=%d)" % (helpFile, helpId) raise return ado ------------ This is the result ------------------ Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data Source="out\Stoermeld-B97.mdb"' The Access call failed with code -2147352567: Ausnahmefehler aufgetreten. The source of the error is ADODB.Connection The error message is Der Provider kann nicht gefunden werden. M?glicherweise ist er nicht richtig installiert worden. More info can be found in C:\WINDOWS\HELP\ADO270.CHM (id=1240655) Traceback (most recent call last): File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 1117, in options.opcid) File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 893, in write_oms myoms = omsdatabase.OMS(omsname) File "D:\PRJ\DPS\bin\omsdatabase.py", line 225, in __init__ self._ADOconnectionObject = access_open(filename) File "D:\PRJ\DPS\bin\omsdatabase.py", line 183, in access_open ado.Open(connectionstring) File "C:\Python27\lib\site-packages\win32com\gen_py\B691E011-1797-432E-907A-4D8C69339129x0x6x1.py", line 3523, in Open , UserID, Password, Options) File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 459, in _ApplyTypes_ self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, u'ADODB.Connection', u'Der Provider kann nicht gefunden werden. M\xf6glicherweise ist er nicht richtig installiert worden.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240655, -2146824582), None) --------- ---- if I try the ACE 12 string that should (according to some googling) belong to the JET module of Access 2007 which is installed on the PC (opening the mdb with double click works just fine), I get: ----- Open ADOB.Connection with 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source="out\Stoermeld-B97.mdb"' The Access call failed with code -2147352567: Ausnahmefehler aufgetreten. The source of the error is ADODB.Connection The error message is Der Provider kann nicht gefunden werden. M?glicherweise ist er nicht richtig installiert worden. More info can be found in C:\WINDOWS\HELP\ADO270.CHM (id=1240655) Traceback (most recent call last): File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 1117, in options.opcid) File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 893, in write_oms myoms = omsdatabase.OMS(omsname) File "D:\PRJ\DPS\bin\omsdatabase.py", line 225, in __init__ self._ADOconnectionObject = access_open(filename) File "D:\PRJ\DPS\bin\omsdatabase.py", line 183, in access_open ado.Open(connectionstring) File "C:\Python27\lib\site-packages\win32com\gen_py\B691E011-1797-432E-907A-4D8C69339129x0x6x1.py", line 3523, in Open , UserID, Password, Options) File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 459, in _ApplyTypes_ self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, u'ADODB.Connection', u'Der Provider kann nicht gefunden werden. M\xf6glicherweise ist er nicht richtig installiert worden.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240655, -2146824582), None) ------ I must admit that I have little knowledge about COM and wrote this code by copying and modyfiying code examples I found. It worked rather well in the past, but now it fails for me (and still works for other people). What can I try next? Is this the best way to access an mdb database from python (2.7) or what would be preferred? Mit freundlichen Gr??en Dr. Hartmut Niemann Siemens AG Mobility MO MLT LM EN CCI 1 Werner-von-Siemens-Str. 67 91052 Erlangen, Deutschland Tel.: +49 9131 7-34264 Fax: +49 9131 7-26254 mailto:hartmut.niemann at siemens.com Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Siegfried Russwurm, Ralf P. Thomas; Sitz der Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodperson at rodperson.com Mon Apr 20 16:15:14 2015 From: rodperson at rodperson.com (Rod Person) Date: Mon, 20 Apr 2015 10:15:14 -0400 Subject: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden In-Reply-To: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> References: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> Message-ID: <553509F2.6020708@rodperson.com> On 04/20/2015 9:49 AM, Niemann, Hartmut wrote: > > this is the source > > -------------------- > > try: > > print "Open ADOB.Connection" > > ado = win32com.client.Dispatch("ADODB.Connection") > > connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data > Source=\"%s\"" % filename # Access 2003 > > #connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data > Source=\"%s\"" % filename # Access 2007 > > print "Open ADOB.Connection with '%s'" % connectionstring > > ado.Open(connectionstring) > > except pythoncom.com_error, (hr, msg, exc, arg): # pylint: > disable=E1101 > > print "The Access call failed with code %d: %s" % (hr, msg) > > if exc is None: > > print "There is no extended error information" > > else: > > wcode, source, text, helpFile, helpId, scode = exc > > print "The source of the error is", source > > print "The error message is", text > > print "More info can be found in %s (id=%d)" % (helpFile, > helpId) > > raise > > return ado > > ------------ > > This is the result > > ------------------ > > Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data > Source="out\Stoermeld-B97.mdb"' > > The Access call failed with code -2147352567: Ausnahmefehler aufgetreten. > > The source of the error is ADODB.Connection > > The error message is Der Provider kann nicht gefunden werden. > M?glicherweise ist er nicht richtig installiert worden. > I don't read or speak German so my thought on what this error says could be wrong but, it looks like it is saying that the Data Provider is missing. If so, you need Jet.OLEDB.4.0 providers install on the machine. They should be install with Access 2000 but am assume you just have the mdb file. Might want to check the MS site to see if you can download the provider without Access 2000. -- Rod "Times are bad. Children no longer obey their parents, and everyone is writing a book." -- Marcus Tullius Cicero(106 BC - 43 BC) -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon Apr 20 19:29:15 2015 From: timr at probo.com (Tim Roberts) Date: Mon, 20 Apr 2015 10:29:15 -0700 Subject: [python-win32] Error R6034 when I import uuid In-Reply-To: References: Message-ID: <5535376B.1010104@probo.com> Blair Hall wrote: > > > > One ugly alternative would be to edit sys.path in your code before you > start your imports. If you remove everything but the Windows > directories, that should solve the problem. > > > I don't follow. Surely sys.path has nothing to do with it? It is the > LoadLibrary("msvcr90") call from _cytpes.pyd that seems to be the > problem here and that is not using the sys.path (or is it?). Absolutely, yes. DLLs are found through the path exactly like any other executable. You can read about the DLL search algorithm in excruciating detail here, although this omits some of the ugly subtleties of the side-by-side nonsense used by msvcr90 and friends: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx > I have used py2exe on another project that creates an EXE. This > project also imports uuid (it basically imports the same stuff I am > using now, but for a different application). In that case, the > manifest seems to work as expected. So, I wonder what is different in > the case of my DLL? Well one thing that I can think of is that the > problem arises when registering the DLL as a COM server, using > regsvr32. Could it be that Windows does not know to look for the > manifest in the right place because it is regsvr32 that is running?! It's not that easy. As I said, the manifest you have provided is not actually connected to your DLL. It merely lets the operating system know about the runtime library that you have included. If the DLL search path comes to your folder, the fact that you have provided a manifest means that the system is allowed to find your version of msvcr90. If there is someone else earlier in the search order that also has one, it will find that one instead. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From vernondcole at gmail.com Tue Apr 21 00:46:53 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Mon, 20 Apr 2015 16:46:53 -0600 Subject: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden In-Reply-To: <553509F2.6020708@rodperson.com> References: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> <553509F2.6020708@rodperson.com> Message-ID: I also cannot read German, and also I guess that you do not have the correct provider. There are numerous difficulties with 64 vs 32 bit providers for Access (Jet) databases. More information about providers can be found on the links in http://adodbapi.sourceforge.net/quick_reference.pdf I in reviewing my answer, I find that the link to the "hacked" 12.0 versions of the provider at http://shares.digvil.info/redis/ was broken, so I repaired the site. -- Vernon Cole On Mon, Apr 20, 2015 at 8:15 AM, Rod Person wrote: > On 04/20/2015 9:49 AM, Niemann, Hartmut wrote: > > this is the source > > -------------------- > > try: > > print "Open ADOB.Connection" > > ado = win32com.client.Dispatch("ADODB.Connection") > > connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data > Source=\"%s\"" % filename # Access 2003 > > #connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data > Source=\"%s\"" % filename # Access 2007 > > print "Open ADOB.Connection with '%s'" % connectionstring > > ado.Open(connectionstring) > > except pythoncom.com_error, (hr, msg, exc, arg): # pylint: > disable=E1101 > > print "The Access call failed with code %d: %s" % (hr, msg) > > if exc is None: > > print "There is no extended error information" > > else: > > wcode, source, text, helpFile, helpId, scode = exc > > print "The source of the error is", source > > print "The error message is", text > > print "More info can be found in %s (id=%d)" % (helpFile, > helpId) > > raise > > return ado > > ------------ > > This is the result > > ------------------ > > Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data > Source="out\Stoermeld-B97.mdb"' > > The Access call failed with code -2147352567: Ausnahmefehler aufgetreten. > > The source of the error is ADODB.Connection > > The error message is Der Provider kann nicht gefunden werden. > M?glicherweise ist er nicht richtig installiert worden. > > > I don't read or speak German so my thought on what this error says could > be wrong but, it looks like it is saying that the Data Provider is > missing. If so, you need Jet.OLEDB.4.0 providers install on the machine. > They should be install with Access 2000 but am assume you just have the mdb > file. Might want to check the MS site to see if you can download the > provider without Access 2000. > > -- > Rod > > ?Times are bad. Children no longer obey their parents, and everyone is writing a book.? > -- Marcus Tullius Cicero(106 BC - 43 BC) > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Tue Apr 21 02:21:41 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Mon, 20 Apr 2015 18:21:41 -0600 Subject: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden In-Reply-To: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> References: <1AE3002F400CE4498072DFDF74A843CC1F3AC605@DEFTHW99EH3MSX.ww902.siemens.net> Message-ID: On Mon, Apr 20, 2015 at 7:49 AM, Niemann, Hartmut < hartmut.niemann at siemens.com> wrote: > [...] > > Is this the best way to access an mdb database from python (2.7) or what > would > > be preferred? > > > Rather than programming ADO by COM interface, you might find it easier or more convenient to use the standard Python db-api interface provided by sourceforge.net/projects/adodbapi . It uses the same providers that you are struggling with now (it calls the ADO COM interface for you) so it will not help with your existing problem, unfortunately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.Holtz at gmx.net Tue Apr 21 08:23:41 2015 From: A.Holtz at gmx.net (Andreas Holtz) Date: Tue, 21 Apr 2015 08:23:41 +0200 Subject: [python-win32] Oldest Python version for pywin32? In-Reply-To: References: <55282F92.6020309@timgolden.me.uk> <552E2B3E.5000303@gmail.com> <552E3CAA.4010604@timgolden.me.uk> Message-ID: <5535ECED.5060606@gmx.net> I am one 2.5 user, too. Reason is, that thanks to 4Suite (which is a fantastic XML framework) we are bound to 2.5. I didn't find a better XML framework for Python but it's not gonna developed further and will not be ported to 3.x (reminds me of contacting Jeremy Kloth for a port to a newer Python version). But on the other hand, I don't download PyWin regulary and stick with the version we are currently using (214, I think). If a piece of software works fine (enough), there is no need to downloading a newer version. So see it as a complement that people are happy with the software :-) Vernon D. Cole schrieb am 15.04.2015 um 15:59: > I concur.? I am one of the 100 downloads of 2.5 -- and the only reason I download it is to test it, > not to use it in production.? How many of the other downloaders are like me? Most, I would bet. > Dropping 2.5 would allow use of many Python3 features, since 2.6 has the backports for them (print > function, "{}".format(), byte literals, and especially "except ... as"). It would simplify the > Python code in the library. > > On Wed, Apr 15, 2015 at 4:25 AM, Tim Golden > wrote: > > On 15/04/2015 10:11, Mark Hammond wrote: > > Hi Tim, > >? ? I still build for 2.5 and 3.1, but really only because they do still > > build. If there's a reasonable reason to drop support for some I doubt > > it will hurt many people - the sourceforge page should show you download > > stats, but last I looked 2.5 was rarely used then, and that was some > > time ago! > > > FWIW the sf page for build 219 shows less than 100 downloads for 2.5/6 > and 3.1/2. > > Unsuprisingly 2.7 dominates with 3,000 downloads at 32-bit (2,000 at > 64-bit). > > 3.3 comes in just over 100 and 3.4/5 each a few hundreds. > > So I feel no particular compunction about dropping forward support for > 2.6 and lower and 3.2 and lower. (Could say 2.5/3.1 but it's the same > SDK level I think). > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > From blairdhall at gmail.com Tue Apr 21 23:35:14 2015 From: blairdhall at gmail.com (Blair Hall) Date: Wed, 22 Apr 2015 09:35:14 +1200 Subject: [python-win32] Error R6034 when I import uuid Message-ID: > I have used py2exe on another project that creates an EXE. This > > project also imports uuid (it basically imports the same stuff I am > > using now, but for a different application). In that case, the > > manifest seems to work as expected. So, I wonder what is different in > > the case of my DLL? Well one thing that I can think of is that the > > problem arises when registering the DLL as a COM server, using > > regsvr32. Could it be that Windows does not know to look for the > > manifest in the right place because it is regsvr32 that is running?! > > It's not that easy. As I said, the manifest you have provided is not > actually connected to your DLL. It merely lets the operating system > know about the runtime library that you have included. If the DLL > search path comes to your folder, the fact that you have provided a > manifest means that the system is allowed to find your version of > msvcr90. If there is someone else earlier in the search order that also > has one, it will find that one instead. > I get your point that the first manifest I provided is not specific to the DLL, but the second (embedded in the DLL) manifest that I posted seems to identify a particular version of msvcr90.dll. Sadly, Windows does not worry about matching the version of msvcr90.dll: it just loads the first one it finds with the correct name. So what is the embedded manifest in the DLL really there for? I suppose in the case of my other project that produces an executable, Windows is going to include the executable folder early in the search path, so the runtime library is found via the manifest in that case? Anyway, you say "the manifest you have provided is not actually connected to your DLL". Is there something that I can do with these manifests so that there is a connection? -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Apr 22 22:35:59 2015 From: timr at probo.com (Tim Roberts) Date: Wed, 22 Apr 2015 13:35:59 -0700 Subject: [python-win32] Error R6034 when I import uuid In-Reply-To: References: Message-ID: <5538062F.8010806@probo.com> Blair Hall wrote: > > > I get your point that the first manifest I provided is not specific to > the DLL, but the second (embedded in the DLL) manifest that I posted > seems to identify a particular version of msvcr90.dll. Sadly, Windows > does not worry about matching the version of msvcr90.dll: it just > loads the first one it finds with the correct name. So what is the > embedded manifest in the DLL really there for? There's a "greater than or equal to" aspect to this as well. There is a way for a package to say "I can also be loaded when apps ask for earlier releases". There can also be a conflict between the needs of an EXE and the needs of a DLL. If the EXE has a manifest that requests a certain version of the CRT, then a DLL can't really override it. You have an ugly, icky problem, and I'm not quite sure what to advise you. The traces you are showing don't necessarily match with what I would have expected. I don't understand why the Intel version of the CRT is getting chosen, and I don't understand why it's failing to link up with it again later. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From blairdhall at gmail.com Fri Apr 24 09:27:07 2015 From: blairdhall at gmail.com (Blair Hall) Date: Fri, 24 Apr 2015 19:27:07 +1200 Subject: [python-win32] Error R6034 when I import uuid Message-ID: Blair Hall wrote: > > > > > > I get your point that the first manifest I provided is not specific to > > the DLL, but the second (embedded in the DLL) manifest that I posted > > seems to identify a particular version of msvcr90.dll. Sadly, Windows > > does not worry about matching the version of msvcr90.dll: it just > > loads the first one it finds with the correct name. So what is the > > embedded manifest in the DLL really there for? > > There's a "greater than or equal to" aspect to this as well. There is a > way for a package to say "I can also be loaded when apps ask for earlier > releases". > > There can also be a conflict between the needs of an EXE and the needs > of a DLL. If the EXE has a manifest that requests a certain version of > the CRT, then a DLL can't really override it. > > You have an ugly, icky problem, and I'm not quite sure what to advise > you. The traces you are showing don't necessarily match with what I > would have expected. I don't understand why the Intel version of the > CRT is getting chosen, and I don't understand why it's failing to link > up with it again later. > Oh well, thanks for trying. Google searches on this type of problem throw up a few other instances that look similar, but I have not found a definitive answer. Perhaps it's simply old technology and people have moved on. I suppose that if I were using Python 3.x there would be no problems at all. I have a work-around (wrote my own version of the function I needed from the uuid module), so I might not have to worry about this anymore, but if anyone finds this thread and has an answer, I'd sure like to know. -------------- next part -------------- An HTML attachment was scrubbed... URL: From divelez69 at gmail.com Thu Apr 30 23:06:47 2015 From: divelez69 at gmail.com (=?UTF-8?Q?Diego_V=C3=A9lez_Torres?=) Date: Thu, 30 Apr 2015 16:06:47 -0500 Subject: [python-win32] I need to make a COM object with py2exe. Please HELP! In-Reply-To: References: <54ECBDCD.1050103@probo.com> Message-ID: Hi Tim: After studying the "Python Programming on Win32" book, I was able to make COM servers . But so far I can pass simple arguments (in both directions) between Visual Basic and the Python COM server (e.g. integers, strings, floats and arrays). I wonder if it's possible to return from the COM server other kind of objects such as graphics to be used directly from the .NET program. To be more precise, I have Python code that uses heavily Numpy and Matplotlib. I want to make a COM server that returns images generated with Matplotlib in order to use within Excel. The best solution I came out was to store the Matplotlib's images as .PNG in temporary files. The COM server would return their paths so Visual Basic could insert them into the spreadsheet with its own commands. Though this solution may work, the images cannot be interactive. A change would require the creation of new images each time, store them, reload them back, etc... all processes together are expensive. Therefore, I wish I could return directly from the COM server an image object that Visual Basic could handle. Another reason why I want to return an image object directly is because I want to use remote COM Servers (DCOMs); where the path solution may not work. There are two things I think should be in the answer: 1) How to make image objects in the COM server so the .NET programs can use. 2) Can Matplotlib create an image that can be used within .NET GUIs. Sincerely yours, Diego 2015-03-09 16:55 GMT-05:00 Diego V?lez Torres : > Thank you Tim. Your advise is been of great help. > > I just purchased M. Hammond's "Python Programming on Win32" book. Though > a bit old the (1999) still is of great help. I have been able to make > simple COM servers so far. However, I have a question regarding the code > examples found in his http://starship.python.net/ web site. Are they > written in Python 1.x... or Python 2.x? I wonder if there are code > examples written for Python 3.x? > > Cheers to all in the mailing list. > > 2015-02-24 13:07 GMT-05:00 Tim Roberts : > > Diego V?lez Torres wrote: >> > >> > I need to make a COM object upon my Python code, so I can call it from >> > .NET programs (ie. Visual Basic, VB6). I need the COM object (or DLL) >> > to be stand alone, because the target PCs where the final programs are >> > going to run won't have Python installed. I know so far that py2exe >> > supports this directly: >> > http://www.py2exe.org/index.cgi/Py2exeAndCtypesComDllServer >> > >> > I've tried to make some samples with the given link's instructions, >> > but I haven't been lucky. I only got empty 'dist' and 'build' folders. >> > I've search for documentation on the web for quite a long time with no >> > luck. I realized that I need more information besides the one provided >> > by the above's link: >> > >> > 1. How the Python module that I want to compile must be written? I >> > mean, all functions and classes in module will be available for >> > the outside code through the COM Object? That module needs >> > specific lines of code? >> > >> >> What you are trying to create is a COM server. If you search for >> "python COM server", you will find many examples. It does have to be >> written in a particular way. You have to identify the functions you >> want to be exposed, the registry program ID, and the registry GUID in >> specially named class members (_public_methods_, _reg_progid_, >> _reg_clsid_). >> >> I suggest you make the COM part work first. Once you have that working, >> then you can dig in to py2exe to make it standalone. >> >> -- >> Tim Roberts, timr at probo.com >> Providenza & Boekelheide, Inc. >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> https://mail.python.org/mailman/listinfo/python-win32 >> > > > > -- > Diego V?lez Torres > divelez69 at gmail.com > Tel?fono: 098 28 57 58 > Cuenca, Ecuador > -- Diego V?lez Torres divelez69 at gmail.com Tel?fono: 098 28 57 58 Cuenca, Ecuador -------------- next part -------------- An HTML attachment was scrubbed... URL: