0

I've searched for answers and tried most of them but none have fixed my problem. I have a pyton script written in Python 3.4. I have import win32api. Upon execution I get:

    import win32api
ImportError: DLL load failed: The specified module could not be found.

Upon researching I found that this can happen for many reasons, not running post-install script, not installing the correct architecture, etc. I installed the amd64 version and I ran the post install script. I don't know what else to do, but I need this to work because I need to print a document from my application.

I'm running windows 8 64 bit under Pentium processor (not AMD) but it was either amd or 32 bit on the sourceforge page. I'm running python 3.4 with 64 bit installed.

5
  • sourceforge.net/projects/pywin32/files/pywin32 under build 219 Commented Jun 6, 2014 at 19:19
  • Check out this page and see if the Py3.4-amd64 version works for you. I've had really good luck with the packages there. Commented Jun 6, 2014 at 19:20
  • Never mind, I just tried it and got the same error. Strange... Commented Jun 6, 2014 at 19:21
  • So the unofficial page didn't work for you either? Commented Jun 6, 2014 at 19:23
  • @MattDMo, I figured it out! Commented Jun 6, 2014 at 19:34

1 Answer 1

2

The answer is so simple no one saw it. You must import pythoncom library first:

import pythoncom
import win32api
import win32print

I hope this helps someone else.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.