title: Python error: OSError: [WinError 193] %1 is not a valid Win32 application
body: <p>After using Anaconda Navigator to update some packages (numpy, matplotlib, ...) and Spyder; my code using these packages no longer works and gives error on import.</p>
  
  <ul>
  <li><p>I tried to reverse the update to a previous version installation,
  without success.</p></li>
  <li><p>I checked
  <a href="https://stackoverflow.com/questions/55021614/python-produces-oserror-winerror-193-1-is-not-a-valid-win32-application">Python produces: OSError: [WinError 193] %1 is not a valid Win32 application</a>;
  but no solution.</p></li>
  <li><p>I checked <a href="https://github.com/pytorch/pytorch/issues/27693" rel="nofollow noreferrer">https://github.com/pytorch/pytorch/issues/27693</a> and looked
  in the PATH on Windows using Environment Variables for User and
  System; but I don't know what to look for.  oggyoggy448 suggested to
  remove and reinstall numpy; tried it a few times and restarting my PC
  but no success.</p></li>
  <li><p><a href="https://python-forum.io/Thread-WinError-193-1-is-not-a-valid-Win32-application" rel="nofollow noreferrer">https://python-forum.io/Thread-WinError-193-1-is-not-a-valid-Win32-application</a>
  suggested running from the command line; which you can find below.</p></li>
  <li><p><a href="https://superuser.com/questions/1485333/getting-oserror-winerror-193-1-is-not-a-valid-win32-application-while-trying">https://superuser.com/questions/1485333/getting-oserror-winerror-193-1-is-not-a-valid-win32-application-while-trying</a> is showing a similar error.</p></li>
  <li><p>I tried uninstalling Anaconda completely and all python versions on
  my PC; after reinstalling Anaconda and Spyder; the same problem
  remains.</p></li>
  </ul>
  
  <p>Looking forward to a better understanding and the resolving suggestion ...</p>
  
  <p>While using the IPython console and just typing below:</p>
  
  <pre><code>In [1]: import numpy
  </code></pre>
  
  <p>This gives the following output:</p>
  
  <pre><code>---------------------------------------------------------------------------
  OSError                                   Traceback (most recent call last)
  &lt;ipython-input-5-d4cdadb62aa7&gt; in &lt;module&gt;
  ----&gt; 1 import numpy
  
  ~\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py in &lt;module&gt;
      138
      139     # Allow distributors to run custom init code
  --&gt; 140     from . import _distributor_init
      141
      142     from . import core
  
  ~\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py in &lt;module&gt;
       24                 # NOTE: would it change behavior to load ALL
       25                 # DLLs at this path vs. the name restriction?
  ---&gt; 26                 WinDLL(os.path.abspath(filename))
       27                 DLL_filenames.append(filename)
       28     if len(DLL_filenames) &gt; 1:
  
  E:\Programs\Anaconda\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
      362
      363         if handle is None:
  --&gt; 364             self._handle = _dlopen(self._name, mode)
      365         else:
      366             self._handle = handle
  
  OSError: [WinError 193] %1 is not a valid Win32 application
  </code></pre>