Menu

#685 import pythoncom fails with conda (pywintypes27.dll and pythoncom27.dll not found)

v1.0 (example)
open
nobody
None
5
2015-02-22
2015-01-14
No

With pywin32 build 219 installed via conda on python 2.7, importing pythoncom fails with
ImportError: No system module 'pywintypes' (pywintypes27.dll)

The issue is that the library pywintypes27.dll is stored not in
pathtovenv\lib\site-packages\win32\lib\pywintypes27.dll
but in
pathtovenv\lib\site-packages\win32\pywintypes27.dll

Adding in the file win32\lib\pywintypes.py the elif part herebelow solves the issue

:::python

    if found is None:
        # Not in the Python directory?  Maybe we were installed via
        # easy_install...
        if os.path.isfile(os.path.join(os.path.dirname(__file__), filename)):
            found = os.path.join(os.path.dirname(__file__), filename)
        elif os.path.isfile(os.path.join(os.path.dirname(__file__), "..", filename)):
            found = os.path.join(os.path.dirname(__file__), "..", filename)

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.