我正在使用带有python 2.7的Ubuntu系统和0.19的pandas版本。我一直在尝试运行python文件并且此错误一直显示 -
>>> import file.py as x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "file.py", line 4, in <module>
import pandas as pd
File "/home/user/.local/lib/python2.7/site-packages/pandas/__init__.py", line 39, in <module>
from pandas.core.api import *
File "/home/user/.local/lib/python2.7/site-packages/pandas/core/api.py", line 20, in <module>
from pandas.core.reshape import (pivot_simple as pivot, get_dummies,
ImportError: cannot import name pivot_simple
请告诉我这个错误可能出现的问题及其删除方式,以帮助我解决问题。
谢谢!
答案 0 :(得分:0)
而不是使用'files.py' 请尝试'导入文件为x'