找不到包“tests”

0 投票
1 回答
20 浏览
提问于 2025-04-13 15:39

我导入了以下内容:

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

但是“tests”没有被识别(导入tests无法解决),我不清楚需要安装哪个包。我用pip安装了:

pip install Office365-REST-Python-Client

我以为tests也会被安装上。可是我找不到叫做tests的包,所以我不敢随便用pip安装tests,怕会造成冲突。有没有人知道我该怎么做?

1 个回答

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

不过这样会安装整个代码库。

撰写回答