我正在尝试导入office365.sharepoint.file,但不断收到错误
ModuleNotFoundError:没有名为“office365.sharepoint.file”的模块
我被卡住了,因为我无法确定用于导入它的方法是否已更改
任何帮助都将不胜感激
import io
from office365.sharepoint.file import File
response = File.open_binary(ctx, relative_url)
#save data to BytesIO stream
bytes_file_obj = io.BytesIO()
bytes_file_obj.write(response.content)
bytes_file_obj.seek(0) #set file object to start
#read file into pandas dataframe
df = pd.read_excel(bytes_file_obj)```
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-9-ce2948d5390a> in <module>
1 import pandas as pd
2 import io
----> 3 from office365.sharepoint.file import File
4
5 response = File.open_binary(ctx, relative_url)
ModuleNotFoundError: No module named 'office365.sharepoint.file'```
尝试安装o365库。这会解决你的问题
我发现必须将完整URL路径设置为文件,而不仅仅是路径:
from office365.sharepoint.files.file import File
相关问题 更多 >
编程相关推荐