OSError: [WinError 193] %1 is not a valid Win32 application

Hi.

I used to have a stable version running of CW, but after updating to the newest version I keep getting the error:
OSError: [WinError 193] %1 is not a valid Win32 application, when trying to activate (or run) cw.
Also my old version of cw is not running anymore. Any idea why this is happening?

Thanks for any help

Hi,

Have you installed ChipWhisperer via the Windows installer? If so, can you open ChipWhisperer5_64/WPy64-3740/WinPython Command Prompt.exe

  1. Run python and try importing chipwhisperer and connecting to your scope
  2. Try running jupyter notebook

If both of those work, try opening ChipWhisperer5_64/chipwhisperer_update/Git/git-bash.exe and seeing if that one works as well

Alex

So i installed it via the windows installer, and I opened the command prompt. Which are the commands for connecting to the scope via this? The usual commands “import chipwhisprer as cw” and jupyter notebook did not work. It complained about invalid syntax

The really weird thing is that i manage to get stuff working in the git terminal by using python -c “import chipwhisperer as cw” and then python -m notebook. Then it opens up jupyter and it seems to be working. Lets see if I still get the same error…

ironically I now got the error “no module named chipwhisperer”…

What if you explicitly run ChipWhisperer5_64/WPy64-3740/python-3.7.4.amd64/python.exe?

Still get the same error when writing “import chipwhisperer as cw”. Still complains that it is not a valid win32 application

Ah, so it fails on the chipwhisperer import? It seems like the python installation might be borked. Do any other imports work when you run python?

it seems so. I am thinking it is the paths that are messed up somehow. Because I remember when installing CW manually earlier that there was some issues with getting it to work correctly

But are the drivers for cw automatically installed in the new version or must they still be manually enabled?

IIRC that one is there because installing in a location where you don’t have write access (like Program Files) would cause errors. That one should be pretty evident as soon as you install.

The driver situation is a bit complicated. If you have the latest firmware update (0.21 on CWLite/Nano) and you don’t have any drivers installed for ChipWhisperer, it should automatically run with the correct drivers. The old drivers should work, but I’m currently investigating if that’s always true (works on my machine, but maybe not on others :slight_smile: )

Now that you mention drivers, we did add a libusb dll since they wouldn’t be copied over to system32 when you installed drivers as in the past. That might be causing it. What’s your system configuration? Are you running 64-bit windows?

Se should i try to reinstall cw into another location? It seems like that may create issues indeed.
I think maybe I have to install the drivers manually

Feel free to give it a try, but I don’t think that’s your issue. Might still be worth a try though. This error I believe is due to a dll issue. Try opening that Winpython command prompt I mentioned in my first reply and run:

cd ..\..\chipwhisperer
python setup.py develop
pip install --upgrade pyusb

So I checked. All drivers and everything should be fine. It seems like I have to reinstall everything…

Also is there a stack trace of the error?

When I run the commands above I get some error: ERROR: chipwhisperer 5.3.1 requires fastdtw, which is not installed.
Appart from that everything seems to be working. Appart from an old version of pip apparently

Alright, is there a stack trace when you try to import chipwhisperer?

Try this from the WinPython command prompt:

pip uninstall numpy
pip install numpy

Alternatively, try this in a jupyter notebook:

%%bash
pip uninstall numpy
pip install numpy