Solution to python problem

topic description

AttributeError: module "pandas" has no attribute" DataFrame"

sources of topics and their own ideas

programming encounters

related codes

import requests
from lxml import etree

url = "https://book.douban.com/subject/1084336/comments/"
r = requests.get(url).text

s = etree.HTML(r)
file = s.xpath("//div[@class="comment"]/p/span/text()")

import pandas as pd
df = pd.DataFrame(file)
df.to_excel(pinglun.xlsx)

what result do you expect? What is the error message actually seen?

the solutions that have been searched on the Internet are useless. I beg all of you to solve your doubts!

Apr.29,2021
There is no DataFrame, under the

pandas module. Is there a package called pandas under your entry file? Python packet search order, first, from the system default module, second, from the entry file, third, from the sys.path inside.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35fa3-2bfbc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35fa3-2bfbc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?