1

I am on windows 10 with pip version 20.2.1 and I used pip install pandas and it says I have successfully installed pandas but when I try to import it it says it is an unresolved import and also gives me the error...

PS C:\WINDOWS\system32> & C:/Users/dannyz/AppData/Local/Programs/Python/Python38-32/python.exe "c:/Users/dannyz/Desktop/Python/Excel Automation.py"
Traceback (most recent call last):
  File "c:/Users/dannyz/Desktop/Python/Excel Automation.py", line 1, in <module>
    import pandas
  File "c:\Users\dannyz\Desktop\Python\pandas\__init__.py", line 11, in <module>
    __import__(dependency)
  File "c:\Users\dannyz\Desktop\Python\numpy\__init__.py", line 138, in <module>
    from . import _distributor_init
  File "c:\Users\dannyz\Desktop\Python\numpy\_distributor_init.py", line 26, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Users\dannyz\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

This is my code..

import pandas as pd

print("hello")
PApostol
  • 2,152
  • 2
  • 11
  • 21
  • does this answer your question? https://stackoverflow.com/questions/55917699/how-to-fix-oserror-winerror-193-1-is-not-a-valid-win32-application – PApostol Aug 10 '20 at 19:52
  • I have done everything that was suggested and I am now getting a different error and it is still not workingTraceback (most recent call last): File "c:/Users/dannyz/Desktop/Python/Excel Automation.py", line 1, in import pandas as pd ModuleNotFoundError: No module named 'pandas' – user14006308 Aug 11 '20 at 18:21

1 Answers1

0

This problem is caused by conflicting program paths; you have Python files in two different places:

C:/Users/dannyz/AppData/Local/Programs/Python/Python38-32/

And

c:/Users/dannyz/Desktop/Python/

I googled the error code and came across this GitHub thread here about it. It seems you need to reinstall Python after deleting the original files, and/or moving the python files you already have. Be sure to backup all the programs you want to keep.

davetherock
  • 224
  • 1
  • 2
  • 12
  • I have done everything that was suggested and I am now getting a different error and it is still not workingTraceback (most recent call last): File "c:/Users/dannyz/Desktop/Python/Excel Automation.py", line 1, in import pandas as pd ModuleNotFoundError: No module named 'pandas' – user14006308 Aug 11 '20 at 18:21