python3使用pandas在IDE上工作,但在程序中不工作

2024-10-01 09:25:01 发布

您现在位置:Python中文网/ 问答频道 /正文

从终端执行代码时出现以下错误:

AttributeError: module 'pandas' has no attribute 'Series'

根据此代码:

import pandas
numbers = {1,2,3,4,5}
ser = pandas.Series(list(numbers))
print(ser)

但同样的代码在IDE中也可以正常工作

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> numbers = {1,2,3,4,5}
>>> ser = pandas.Series(list(numbers))
>>> ser
0    1
1    2
2    3
3    4
4    5
dtype: int64

你知道吗搜索路径地址:

['C:\\Users\\norman.khine\\Documents\\CodeCommit\\sysadmin\\scripts', 'C:\\Python36\\python36.zip', 'C:\\Python36\\DLLs', 'C:\\Python36\\lib', 'C:\\Python36', 'C:\\Users\\norman.khine\\AppData\\Roaming\\Python\\Python36\\site-packages', 'C:\\Python36\\lib\\site-packages', 'C:\\Python36\\lib\\site-packages\\whois-0.1-py3.6.egg']

所有其他模块导入正确!你知道吗

有什么帮助吗?你知道吗


Tags: 代码import终端pandaslibpackagessiteusers