找不到包“tests”

问题描述 投票:0回答:2

我导入了以下内容:

from office365.sharepoint.client_context import ClientContext
from tests import test_user_credentials, test_team_site_url

但是无法识别“测试”(无法解析导入测试),尚不清楚需要安装什么包。我安装了 pip:

pip install Office365-REST-Python-Client

我认为测试也会被安装。我找不到一个名为tests的包,如果它引起冲突,我会很紧张地使用pip安装测试。有谁知道我需要做什么?

python sharepoint
2个回答
0
投票

您可以从这里复制

tests

https://github.com/vgrem/Office365-REST-Python-Client/tree/master/tests

或使用 Git 克隆存储库。

您也可以尝试:

pip install git+https://github.com/vgrem/Office365-REST-Python-Client.git@master

但这将安装整个存储库。


0
投票

拼写,我有同样的问题,收到错误消息“ModuleNotFoundError:没有名为“tests”的模块”。如何在 Python 中从 https://github.com/vgrem/Office365-REST-Python-Client/tree/master/tests 复制“测试”?你能分享一个示例代码吗?谢谢!

在此输入图片描述

© www.soinside.com 2019 - 2024. All rights reserved.