本文主要是介绍ipython import pandas出错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
其实这个错误是早上就发现了的,但是由于代码上运行没得问题,我就纳闷了,但是可以运行代码就无伤大雅。
下午事情差不多了,想起这个问题,就来debug一下。
为了让错误更加清晰的呈现出来,我又要费大家电了<哈哈>,下面就是报的完整错误。
In [13]: import pandas as pd
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.Traceback (most recent call last):File "~/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2862, in run_codeexec(code_obj, self.user_global_ns, self.user_ns)File "<ipython-input-13-af55e7023913>", line 1, in <module>import pandas as pdFile "~/anaconda3/lib/python3.6/site-packages/pandas/__init__.py", line 55, in <module>from pandas.core.api import (File "~/anaconda3/lib/python3.6/site-packages/pandas/core/api.py", line 24, in <module>from pandas.core.groupby import Grouper, NamedAggFile "~/anaconda3/lib/python3.6/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>from pandas.core.groupby.generic import ( # noqa: F401File "~/anaconda3/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 41, in <module>import pandas.core.algorithms as algorithms
AttributeError: module 'pandas' has no attribute 'core'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "~/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 1806, in showtracebackstb = value._render_traceback_()
AttributeError: 'AttributeError' object has no attribute '_render_traceback_'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "~/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 1090, in get_recordsreturn _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)File "~/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 311, in wrappedreturn f(*args, **kwargs)File "~/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 345, in _fixed_getinnerframesrecords = fix_frame_records_filenames(inspect.getinnerframes(etb, context))File "~/anaconda3/lib/python3.6/inspect.py", line 1488, in getinnerframesframeinfo = (tb.tb_frame,) + getframeinfo(tb, context)File "~/anaconda3/lib/python3.6/inspect.py", line 1446, in getframeinfofilename = getsourcefile(frame) or getfile(frame)File "~/anaconda3/lib/python3.6/inspect.py", line 696, in getsourcefileif getattr(getmodule(object, filename), '__loader__', None) is not None:File "~/anaconda3/lib/python3.6/inspect.py", line 725, in getmodulefile = getabsfile(object, _filename)File "~/anaconda3/lib/python3.6/inspect.py", line 709, in getabsfilereturn os.path.normcase(os.path.abspath(_filename))File "~/anaconda3/lib/python3.6/posixpath.py", line 376, in abspathcwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
重点在后面的getcwd,报的错误是美的这个目录或者文件夹。
报错原因: 我在terminal中运行了ipython程序,由于代码更新,我将这个目录删除了,然后使用getcwd就出了问题。
这个bug我感觉应该是python的bug,但是python也没得义务来修复。
以后注意一点,python运行的项目,可能长期存在这个问题。
这篇关于ipython import pandas出错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!