0

I have been playing around with PTVS 2.1 Beta 2 and Visual Studio Express 2013 with upgrade 3. I liked a lot of the features in PTVS so I was excited to give it a try. So far it is OK, but I have one major and confusing problem.

I am running Enthought Canopy Express 32 bit.

I rely on the pywin32 library a lot to connect to com objects. When I tried running some of my code that uses pywin32 through PTVS it fails. The line that fails in my code is:

from win32com.client import *

Here is the error:

   File "C:\Users\[username]\AppData\Local\Enthought\Canopy32\User\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.

The weird thing is that if I just launch an interpreter window outside of visual studio (C:\Users[username]\AppData\Local\Enthought\Canopy32\User\python.exe) then the same code works just fine.

I started by comparing sys.path between the two approaches and they are the same.

It appears to me that the win32api.pyd file fails to load some dll that it depends on. I opened win32api.pyd in dependency walker and with the exception of a number of deeply nested late loading dependencies, MSVCR90.DLL was the only thing that could not be located.

I tried copying this from the matplotlib\backends folder to the same folder as win32api.pyd but it did not help. MSVCR90.DLL is NOT in windows\system or windows\sysWOW64.

I would love to use PTVS as my goto, but I'm stuck if I can't get this to work. Any help would be appreciated!

Jesse
  • 63
  • 1
  • 5
  • How did you set up your project to use Canopy as an interpreter? Did you use the PTVS integration support that they provide (where Canopy shows up as a distinct and properly named interpreter in the Python Environments window), or did you just add it as a custom interpreter? – Pavel Minaev Aug 28 '14 at 19:01
  • I installed canopy with the Enthough installer and then PTVS recognized it by default (I think, but I can't remember for sure). After I posted the question I realized that it worked with no files open and didn't work when files were open. That felt like a bug so I filed bug 2633 on the PTVS codeplex page. Then I found the solution below. – Jesse Aug 29 '14 at 11:51

1 Answers1

0

I fixed the problem. Another install of VS 2013 for web was interfering some how. I un-installed it and the problem went away.

Jesse
  • 63
  • 1
  • 5