从命令行运行python脚本并给出空数据帧

从命令行运行python脚本并给出空数据帧,python,powershell,Python,Powershell,如果我在Anaconda中运行此脚本,则会得到结果,但当我使用Powershellpython D:\script\RSSfeeds.py时,结果是空数据帧 导入feedparser 作为pd进口熊猫 rawrss=['https://feeds.livep2000.nl?'] 提要=[] 对于rawrss中的url: feeds.append(feedparser.parse(url)) 职位=[] 对于输入源: 对于在feed.entries中发布的内容: posts.append((pos

如果我在Anaconda中运行此脚本,则会得到结果,但当我使用Powershell
python D:\script\RSSfeeds.py
时,结果是空数据帧

导入feedparser
作为pd进口熊猫
rawrss=['https://feeds.livep2000.nl?']
提要=[]
对于rawrss中的url:
feeds.append(feedparser.parse(url))
职位=[]
对于输入源:
对于在feed.entries中发布的内容:
posts.append((post.published,post.title,post.link,post.description,post.description.partition(“”[2]。partition(“”)[0]。strip(),post.description.partition(“”[2]。post.description.0”)[0]。strip(),getattr(post,“geo_long”,0),getattr(post,“geo_lat”,0)))
df=pd.DataFrame(posts,columns=['Date','Titel','link','summary','capcode','dienst','geo_long','geo_lat'])
df['dienst']=df['capcode'].str.replace(r'\d+','').str.replace('-','')
打印(df)

我犯了什么错误。有什么建议吗?

我可以使用您的codeEmpty DataFrame列获得输出:[日期、滴度、链接、摘要、capcode、dienst、geo_long、geo_lat]索引:[]当您从命令行Powershell(如python D:\script\RSSfeeds.py)运行此命令时,输出为空DataFrame我发现了我的问题