-
Notifications
You must be signed in to change notification settings - Fork 798
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 pywin32==225 failed #1406
Comments
Does |
I observe a similar problem with Python 27 ( here with a fresh pywin32==225 installation in a new virtualenv )
|
I install pywin32 in venv, (.venv) C:\Users\caosw\sock-test>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywintypes
>>> pywintypes.__file__
'D:\\ProgramData\\Anaconda3\\Library\\bin\\pywintypes36.dll'
>>> import pywin32
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32'
>>> >>> sys.path
['', 'E:\\test\\credssp\\.venv\\Scripts\\python36.zip', 'D:\\ProgramData\\Anaconda3\\DLLs', 'D:\\ProgramData\\Anaconda3\\lib', 'D:\\ProgramData\\Anaconda3', 'E:\\test\\credssp\\.venv', 'E:\\test\\credssp\\.venv\\lib\\site-packages', 'E:\\test\\credssp\\.venv\\lib\\site-packages\\win32', 'E:\\test\\credssp\\.venv\\lib\\site-packages\\win32\\lib', 'E:\\test\\credssp\\.venv\\lib\\site-packages\\Pythonwin'] I find that pywin32.pth append to sys.path, after Anaconda3's path. so |
Does Anaconda come with a pywin32 version? It looks like that pywintypes36.dll isn't the one from pywin32 225, which would explain the issue.
There's no 'pywin32' module in the package, so that's expected. |
What is |
I am receiving the same error with 225 in a fresh Tox virtual environment. No issue in 224; not using Conda or anything exotic. |
I have the same Problem starting a script on windows python 3.7.4. 64 bit.
I switched back to 224 for now. |
See my above comment - I can only reproduce this if there's an old |
(Running with pywin32==225):
|
On AWS Windows AMIs
|
Thanks for that info - that file will need to be replaced with the one that comes with pywin32-225. There's no way for the pywin32 installer to do that because it doesn't know that path exists. |
But possibly it could be solved by prepending instead of appending the |
Possibly, although when I struck this issue locally, that didn't solve it for me. But yeah, I guess it can't hurt. There's also #1417 |
The same problem with |
Running the
|
Yes, this works. So I have to write a new deployment system / pip wrapper for my customer just to install a single dependent wheel which doesn't work out of the box after installation? Hmm.... |
An error like "dll load failed, the specified procedure can not be found" typically means there's already a pywintypesXX.dll in the system32 directory, or somewhere else - typically put there by previously running the postinstall script. It's this other old one which has been loaded. If there's only 1 pywintypesXX.dll on the entire system this error will not occur. So if you have only ever installed via pip, you should not have this issue - pip will never place the file in system32. So if you are having this problem, you should try and find the duplicate and try to work out how it got there. As we see above, for jupyter appears to have shipped with the old version in some strange place, which causes this problem. The postinstall script probably helps fix this case too because the system32 directory ends up taking precedence. It's not clear to me whether all comments here refer to jupyter, but it is clear to me that everyone has the duplicate installed somewhere. |
(and for completeness, an error on 3.8 where the error is that the DLL can not be found (as opposed to a procedure can't be found) is different. I hope to make a new release in the next couple of days that will fix the 3.8 issue, and may help the "procedure not found" issue in some, but not all cases.) |
Hey @mhammond thanks for pointing out the subtle difference and also the comment on xlwings/xlwings#1174. Things work indeed with a python.org installation on a fresh system. I got the "procedure" error on a conda env with Python3.7 where pywin32 was installed via pip. Removing the conda paths from the PATH env vars seems to have fixed this issue. Thanks! |
I am having the issue on xlwings... which lead me to this conversation . "ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden." aka Procedure not found. @fzumstein additionally can you tell me of the working/test/known combination of XLwings version ?? and pywin32 ?? version for Python 3.7. Best regards |
@Alezy80 |
@AT66, I was copy |
@AT66 you can follow these instructions https://www.computerhope.com/issues/ch000549.htm to edit your PATH. You might want to take out any path that leads to a python directory. If you use conda, it will set the PATH during a |
@azoellner 's suggestion of prepending the path has been done in 71afa71 for Python versions older than 3.8. For Python >= 3.8, the Python 3.7 has also reached EOL (meaning no security fixes/support) and I'd recommend migrating over to 3.8+ (see #2207) .exe installers are now deprecated #1939, so you should install from PyPI (ie: Given the sheer amount of "ImportError: DLL load failed: The specified module could not be found." issue duplication and old history, I'd like to consolidate the current state of these issues. So I'll close and reference back any issue that only has comments showing the issue:
Please also try https://github.com/mhammond/pywin32#troubleshooting before opening a new issue, or let us, and others, know here if it did fix your issue. If you're having this issue with Jupyter Notebooks, refer to #1409 instead. Closing as duplicate of #1399 |
Hi, I install latest pywin32(
pywin32 ==225
) module, import failed. This is my python and os information.Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
This is error case.
The text was updated successfully, but these errors were encountered: