简体   繁体   中英

I am trying to install pandas as pd in python 3.8 and I am getting a continuous error

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")

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM