代码可以运行和调试 但显示“未解决的导入'请求'Python(unresolved-import)” 我还有其他设置吗?
import requests
import os
url = 'https://www.google.com'
response = requests.get(url)
response.encoding = 'utf-8'
html = response.text
path = os.path.abspath(os.path.dirname(__file__))+'\\test.txt'
with open(path, 'w', encoding = 'gbk') as f:
f.write(html)
答案 0 :(得分:0)
您正在与虚拟环境中的Python解释器一起工作吗?