hwm
hwm

Reputation: 117

Python 2.7 script crashes on brand new machine

The Situation:

I mostly use MATLAB. I don't know Python at all, but a co-worker wrote a data acquisition program in it. My MATLAB work is on hold until I get this Python script running on my machine, but it crashes on run. I need to get this working, but the code has zero comments, and I can't afford to learn an entirely new language for this one thing.

I'm using Python 2.7.11, PyCharm 2016.1.2 Professional. I copy/pasted the folder from my co-worker's computer with the project in it, but it crashes when I try to run it on my machine. PyCharm doesn't find any errors before runtime. This is the error message:

File "C:\Users\mherunter\Desktop\LabTest\flask\lib\site-
packages\UniversalLibrary\UniversalLibrary.py", line 57, in <module>
cbw = ctypes.windll.cbw32 # open CBW32.DLL
File "c:\python27\Lib\ctypes\__init__.py", line 435, in __getattr__
dll = self._dlltype(name)
File "c:\python27\Lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

What I Have Tried:

I looked at some other answers on here and read about a couple possible problems. I don't think that something like '\t' in a filepath is getting converted to a TAB character, since the code runs fine on a different machine. I'm not familiar with DLL's much, but it seems like the computer can't open CBW32.DLL. I searched my computer for it and the file doesn't show up.

I tried changing this to CBW64, since my machine is 64bit, but got the same error message. It's a 32bit installation of Python I think, platform.architecture() says 32bit.

I also tried this on a brand-new (first thing I did after taking it out of the box sort of new) computer, Windows 10. That didn't work, but I read that I might need to install a C++ compiler to get all of the necessary DLL's. Installled VS Community 2015 with Visual C++, but that didn't help either.

The last thing I've seen on here is rebuilding the DLL with \MT to make it stand alone. I tried looking for how do to this online, but didn't have a lot of luck. Can anyone either:

  1. Tell me precisely how to rebuild the DLL with \MT?

  2. Suggest another reason/fix for this problem?

Upvotes: 0

Views: 282

Answers (1)

Samuel
Samuel

Reputation: 3801

Well you can't load dll which doesn't exists on your computer.

cbw32.dll is part of I/O Library for Measurement Computing Data Acquisition Products

So you need to download and install it to get the DLL.

Another way is to search for it on the internet, but beware of fake DLLs, which could be malware.

Upvotes: 2

Related Questions