python - 如何修复 Jupyter Notebook pandas 错误(OSError : [WinError 193] %1 is not a valid Win32 application)

标签 python pandas jupyter-notebook anaconda jupyter

我目前正在机器学习类(class)中从事 Yelp 回归项目。

该项目要求我打开 Jupyter 笔记本并将 pandas 导入为 py。

我使用 Anaconda 导航器打开 Jupyter 笔记本。我得到以下信息:

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

当我尝试为我的代码导入 pandas 时。完整消息:

OSError Traceback (most recent call last)
<ipython-input-2-ed70324e10b6> in <module>

----> 1 import pandas as pd
2 

3 
businesses = pd.read_json('yelp_business.json', lines = True)

4 reviews = pd.read_json('yelp_review.json', lines = True)

5 users = pd.read_json('yelp_user.json', lines = True)


~\AppData\Roaming\Python\Python37\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("{0}: {1}".format(dependency, str(e)))


~\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py in <module>
138 

139 # Allow distributors to run custom init code

--> 140 from . import _distributor_init

141 

142 from . import core


~\AppData\Roaming\Python\Python37\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)

354 

355 if handle is None:

--> 356 self._handle = _dlopen(self._name, mode)

357 else:

358 self._handle = handle


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

我已经尝试卸载和安装 python、anaconda 和 pandas。

My course来自代码学院

最佳答案

您可能在 32 位系统上下载了 64 位 pandas。卸载并重新安装,但要特别注意这一点。

关于python - 如何修复 Jupyter Notebook pandas 错误(OSError : [WinError 193] %1 is not a valid Win32 application),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57667578/

相关文章:

python - 如何将灰度图像转换为像素值列表?

python - 在 python pandas 数据框中查找一行值与剩余行值的差异

python - 我如何与 Python 内核交互 JupyterLab 扩展?

python - Jupyter笔记本: Access to the file was denied

python - 使用 Python tensorflow 进行预测和预测

python - 如何更改 Vim 中的 Python 颜色?

python - 将python协同过滤代码转换为使用Map Reduce

python - 合并多个csv文件与python中不同列的错误与writerow

python - Pandas:处理测试中看不见的数据

python - 基于字符串出现、相似性连接两个数据框