1
votes

I'm using spyder and trying to import pandas as pd and its giving me the following error:

import pandas as pd Traceback (most recent call last):

File "", line 1, in import pandas as pd

File "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\pandas__init__.py", line 13, in import(dependency)

File "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\numpy__init__.py", line 142, in from . import core

File "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.py", line 23, in WinDLL(os.path.abspath(filename))

File "C:\Users\omer qureshi\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

Can someone explain what's wrong?

1

1 Answers

0
votes

Another thing might have happened. VS code automatically searches for the numpy and other packages from predefined OS locations. It might have found out 32 bit version of numpy instead of a 64 bit version. To fix this Uninstall numpy from all OS locations. * In VS code terminal Type pip uninstall numpy or conda uninstall numpy (If you use Anaconda) * Restart VS code * Voila! (Reinstall numpy if the problem persists)