Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Jan 14, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 14, 2015

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)

Reported by: sdementen

Original Ticket: pywin32/bugs/685

@ghost ghost assigned ghost and unassigned ghost Oct 24, 2017
@Avasam
Copy link
Collaborator

Avasam commented Mar 13, 2024

Paths and services issues are replicated in many other issues with more details. Like in #1455 (comment), #1399 and #1865 (and many old closed issues with less details)

@Avasam Avasam closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant