OSError: [WinError 193] %1 is not a valid Win32 application
I'm trying to import qiskit into my pycharm, its installed but when i try to run my code i get this error,
Traceback (most recent call last):
File "C:/Users/Lenovo/Desktop/בצפר/שנה ב/סמסטר ב/מעבדה כלים ביואינפורמטיקה/שיעורי בית/pyCharm files- back up/HW1/ex1.py", line 2, in <module>
import qiskit
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\qiskit\__init__.py", line 29, in <module>
from qiskit.circuit import ClassicalRegister
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\qiskit\circuit\__init__.py", line 16, in <module>
from .quantumcircuit import QuantumCircuit
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\qiskit\circuit\quantumcircuit.py", line 23, in <module>
from qiskit.circuit.instruction import Instruction
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\qiskit\circuit\instruction.py", line 39, in <module>
import numpy
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 23, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Lenovo\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
i tried re downloading anaconda,pycharm,C++ visual tools... everything, wont work
im on windows 10 everything is 64 bit
请先登录再写评论。
Hi,
Have you tried to run it from the command line (outside of PyCharm) using the same interpreter? Do you get the same error?
Yes,
and for some reason i cant import any packages...
It means that the issue is not related to PyCharm.
See similar thread https://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls
thanks! solved my problem, there was an old folder in AppData that wasnt removed with any uninstalls i deleted it, re installed and everything works