从终端执行代码时出现此错误:
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
sys.path中:
['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']
正确导入所有其他模块!
任何帮助?
答案 0 :(得分:0)
将脚本名称更改为ssl.py
以外的其他名称解决了此问题。