2

I have installed numpy via

pip install numpy

However after I executed the command importing numpy as shown below, I encountered the following error message.

>>>> import numpy as np
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\someone\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\__init__.py", line 148, in <module>
    from . import _distributor_init
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\someone\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\_distributor_init.py", line 26, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Users\someone\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

What does it mean and more importantly how should I fix it?

Hans
  • 1,269
  • 3
  • 19
  • 38
  • Also see [these posts](https://stackoverflow.com/search?tab=votes&q=%5bpython%5d%20oserror%20WinError%20193%20%251%20is%20not%20a%20valid%20Win32%20application) – bad_coder Oct 11 '21 at 01:40

1 Answers1

0

Your script does not have necessary permission to run or the environment is messed up may be because of multiple python installed in your system. I would you to clean your environment path and re install python.

  • Could you please give a pointer on how to clean my environment path and establish a good one? – Hans Oct 11 '21 at 00:59