![](/img/trans.png)
[英]How to fix"OSError: [WinError 193] %1 is not a valid Win32 application"
[英]How to fix Jupyter Notebook pandas error (OSError: [WinError 193] %1 is not a valid Win32 application)
我目前正在機器學習課程中從事 Yelp 回歸項目。
該項目要求我打開一個 Jupyter notebook 並將 Pandas 導入為 py。
我使用 Anaconda 導航器打開 Jupyter 筆記本。 我得到以下信息:
(OSError: [WinError 193] %1 不是有效的 Win32 應用程序)
當我嘗試為我的代碼導入熊貓時。 完整信息:
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。
您可能在 32 位系統上下載了 64 位 Pandas。 卸載並重新安裝,但要特別注意這一點。
很可能你的環境搞砸了。 從回溯中可以看出,這里涉及到兩個 python 環境:
C:\\Users\\nouma\\AppData\\Roaming\\Python\\Python37
C:\\Users\\nouma\\Anaconda3
請確保您的PATH
是干凈的,並且您可以先刪除其中一個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.