0

When I'm trying to import the numpy library on Spyder (anaconda), this is the error I get:

    import numpy as np

  File "C:\Users\ndabouz\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init

  File "C:\Users\ndabouz\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\numpy\_distributor_init.py", line 26, in <module>
    WinDLL(os.path.abspath(filename))

  File "C:\Users\ndabouz\AppData\Local\Continuum\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 tried to uninstall and install python, ananconda and numpy library.

Thank you for your help!

nadz
  • 1
  • 1
    have you see this similar question: https://stackoverflow.com/questions/25651990/oserror-winerror-193-1-is-not-a-valid-win32-application – 404pio Nov 25 '19 at 09:05
  • If you have Anaconda installed, then the above error means you installed numpy with pip, which is terrible because it creates this kind of conflicts. To fix please remove this directory: `C:\Users\ndabouz\AppData\Local\Programs\Python\`. – Carlos Cordoba Nov 25 '19 at 17:00
  • 2
    Thkank you very much @CarlosCordoba ! It worked !! :) – nadz Nov 26 '19 at 19:38
  • 1
    @CarlosCordoba that sounds like it would make a good answer with a little explanation of why it works (and perhaps why it is safe). – Weeble Aug 22 '20 at 01:24

0 Answers0