0

I wrote a module consisting of 40 conversions, python 3.7. The module is all def statements with triple quoted HELP info at the beginning. When I try to import it, I get 'ImportError: DLL load failed: %1 is not a valid Win32 application'. I am at a loss as to what to do.

Tried saving as .py and .pyd. Moved file into every environment on my PYTHONPATH. Multitude of google searches, but nothing I could wrap my head around.

Line 1 is:

def main():
    pass

in order to make this work:

if __name__ == '__main__':
    main()

But was getting same import error before I added these elements.

import cunvurtz Traceback (most recent call last): File "P:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in import cunvurtz File "P:\PyCharm Community Edition with Anaconda plugin 2019.1.1\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ImportError: DLL load failed: %1 is not a valid Win32 application.

3
  • Seems like it is something wrong with PyCharm and how you have it set up to run the script. Have you tried simply running your program via the command line: in CMD or Powershell?
    – Tim Klein
    May 15, 2019 at 16:57
  • Is there another file with the name cunvurtz.* on your PATH anywhere?
    – Tim Klein
    May 16, 2019 at 11:45
  • None. I picked the name because their couldn't possibly be a file with that name. May 28, 2019 at 1:40

0

Your Answer

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

Browse other questions tagged or ask your own question.