Importerror: cannot import name Split

I am very new to python and need some help here. I think it comes from PATH,but I have no clue about fixing it. Please help.

Once I type in import split and it keeps popping up

runfile('/Users/zhihaowang/Desktop/untitled1.py', wdir='/Users/zhihaowang/Desktop') Traceback (most recent call last):

File "", line 1, in runfile('/Users/zhihaowang/Desktop/untitled1.py', wdir='/Users/zhihaowang/Desktop')

File "/Users/zhihaowang/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 714, in runfile execfile(filename, namespace)

File "/Users/zhihaowang/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 89, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/Users/zhihaowang/Desktop/untitled1.py", line 8, in from string import split

ImportError: cannot import name 'split'


split is part of standard string method not from string module. Without importing also you could just apply split method. your_str.split()

链接地址: http://www.djcxy.com/p/55288.html

上一篇: 使用networkx / plotly从熊猫数据框创建网络

下一篇: 导入器错误:无法导入名称Split