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 win32file not found #1634

Closed
little-eyes opened this issue Dec 8, 2020 · 5 comments
Closed

import win32file not found #1634

little-eyes opened this issue Dec 8, 2020 · 5 comments

Comments

@little-eyes
Copy link

Note that issues in this repository are only for bugs or feature requests in the pywin32.

If you need support or help using this package, please follow these instructions - support or help requests will be closed without comment.

For all bugs, please provide the following information.

  • Expected behavior and actual behavior.

When I try to use azure.identity package to import ClientSecretCredential, it tries to import win32file, but python raise the following error.

ImportError: DLL load failed while importing win32file: The specified module could not be found.

I would expect the import to be successful.

  • Steps to reproduce the problem.

    • using Python 3.8.3 or Python 3.8.5
    • install the latest azure.identity==1.15.0 package
    • try from azure.identity import ClientSecretCredential
  • Version of Python and pywin32

    • Python 3.8.3 or 3.8.5
    • pywin32 227
    • Microsoft Windows [Version 10.0.19042.630]
@mhammond
Copy link
Owner

mhammond commented Dec 8, 2020

Dupe of #1183, #1409, #1406 and a few others.

@dennisvang
Copy link

This error can also arise if you've installed pywin32 via pip inside a conda environment with python>=3.8.
Workaround in that case is to install pywin32 via conda (from conda-forge, in my case), instead of pip.
More details on SO.

@Soppe
Copy link

Soppe commented Mar 20, 2022

This error can also arise if you've installed pywin32 via pip inside a conda environment with python>=3.8. Workaround in that case is to install pywin32 via conda (from conda-forge, in my case), instead of pip. More details on SO.

Had to scour for hours before finding this. In my case i also had to uninstall the pip-installed version of pywin32 that i had from god knows where. It was version 227. For whatever reason anaconda seemingly kept using this version instead of the conda version i had installed in my anaconda environment.

@vernondcole
Copy link
Collaborator

vernondcole commented Mar 21, 2022 via email

@greekatos
Copy link

This is the right solution. I wondered two days why my exe wasn't working while my script did indeed worked. When I debugged the exe, this error popped: "ImportError: DLL load failed while importing win32api: The specified procedure could not be found. [20540] Failed to execute script 'pyi_rth_win32comgenpy' due to unhandled exception!". The solution I found is located here. Practically, I had to conda install pywin32 in anaconda console(admin mode) and then pip install all the other modules I needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants