Search code examples
python-3.xwindowsanacondaorange

Anaconda/Orange3 produces OSError: [WinError 193] %1 is not a valid Win32 application


When I try to launch Orange 3 under Windows 10 in Anaconda I get the following error:

Traceback (most recent call last):
File "C:\Users\i7\Anaconda3\Scripts\orange-canvas-script.py", line 6, in 
from Orange.canvas.__main__ import main
File "C:\Users\i7\Anaconda3\lib\site-packages\Orange\__init__.py", line 5, in 
from Orange.data import _variable
File "C:\Users\i7\Anaconda3\lib\site-packages\Orange\data\__init__.py", line 4, in 
from .variable import *
File "C:\Users\i7\Anaconda3\lib\site-packages\Orange\data\variable.py", line 9, in 
import numpy as np
File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in 
from . import core
File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 23, in 
WinDLL(os.path.abspath(filename))
File "C:\Users\i7\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

I get the same exact error mesage when I try to start it from the Anaconda command line with

(base) C:\Users\i7>python -m Orange.canvas

Fresh install of Anaconda and Orange 3 (3.23.1) via Navigator (1.9.7) today, and Windows 10 Ver. 1903. The only thing I changed in the Anaconda setup is to install Orange 3.

Any ideas what might be going on? Based on searches I'm suspecting a mismatch of 64 vs 32 bit DLL (maybe?) .. but not sure how to proceed. Plus the whole idea of using something like Anaconda is (to me anyway) to avoid these sort of problems.

I'm totally new to Orange, if there's a better place to ask for help, please let me know and I'll post this there.


Solution

  • In case anyone else comes across this, here's the solution to the problem. The issue was with some left-over directories from a previous installation of Python 3.7 that didn't get deleted during the uninstall process.

    File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py",
    

    Once I deleted this directory (C:\Users\i7\AppData\Roaming\Python\Python37) it all worked. Credit goes to a comment in How to use anaconda packages for python 3.7 on windows 10? by @FlyingTeller