【问题标题】:Need Solution : OSError: [WinError 193] %1 is not a valid Win32 application需要解决方案:OSError: [WinError 193] %1 不是有效的 Win32 应用程序
【发布时间】:2021-12-02 16:39:26
【问题描述】:

将 pandas 导入为 pd

OSError Traceback(最近一次调用最后一次)在 ----> 1 将 pandas 导入为 pd

~\AppData\Roaming\Python\Python38\site-packages\pandas\__init__.py in <module>
      9 for dependency in hard_dependencies:
     10     try:
---> 11         __import__(dependency)
     12     except ImportError as e:
     13         missing_dependencies.append(f"{dependency}: {e}")

~\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py in <module>
    136 
    137     # Allow distributors to run custom init code
--> 138     from . import _distributor_init
    139 
    140     from . import core

~\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py in <module>
     24                 # NOTE: would it change behavior to load ALL
     25                 # DLLs at this path vs. the name restriction?
---> 26                 WinDLL(os.path.abspath(filename))
     27                 DLL_filenames.append(filename)
     28         if len(DLL_filenames) > 1:

~\anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    379 
    380         if handle is None:
--> 381             self._handle = _dlopen(self._name, mode)
    382         else:
    383             self._handle = handle

OSError: [WinError 193] %1 is not a valid Win32 application  

【问题讨论】:

  • 您在~\AppData\Roaming\Python\Python38 的python 安装和您的anaconda 安装之间存在交互。是否可以选择卸载位于~\AppData\Roaming\Python\Python38 的版本?
  • 我试过了,但我仍然面临同样的问题
  • 你能发布新的 Traceback 吗?
  • ~\AppData\Roaming\Python\Python38\site-packages\pandas_init_.py我卸载了上一个后重新安装了python。
  • 这不是我建议的重点。你已经有了anaconda python,所以我建议卸载其他python安装并保持删除

标签: pandas google-analytics anaconda data-science


【解决方案1】:

我得到了答案:

您只需从AppData 中删除Python 文件夹。

它对我有用。

【讨论】:

    猜你喜欢
    • 2019-11-23
    • 2014-10-28
    • 2020-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-10
    • 2021-05-04
    • 2020-02-19
    相关资源
    最近更新 更多