我目前正在机器学习课程中的Yelp回归项目上工作。
这个项目要求我打开一个木星笔记本,并进口熊猫作为py。
我用Anaconda导航器打开木星笔记本。我得到以下信息:
(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和熊猫。
我的课程来自Codeacademy
发布于 2019-08-27 05:04:29
你可能在32位系统上下载了64位熊猫。卸载和重新安装,但要特别注意这一点。
发布于 2020-02-20 17:48:04
很可能你的环境搞砸了。从回溯中可以看到,这里涉及两个python环境:
C:\Users\nouma\AppData\Roaming\Python\Python37
C:\Users\nouma\Anaconda3
请确保您的PATH是干净的,并且您可以首先删除其中的一个。
https://stackoverflow.com/questions/57667578
复制相似问题