我有下面的GitHub工作流,我需要运行python代码来获得令牌,但在步骤运行后,我得到错误"ModuleNotFoundError:没有名为'authlib'的模块"我已经安装了所需的依赖项。当我在本地运行时可以正常工作,请有人帮助我
- name: Get Token
run: |
python -m pip install --upgrade pip
pip install requests-oauthlib
python -c "from authlib.integrations.requests_client import OAuth2Session;"
if __name__ == '__main__':
from authlib.integrations.requests_client import OAuth2Session
token_endpoint = "https://example.com"
client_id = "********"
client_secret = "******"
session = OAuth2Session(client_id, client_secret)
session.fetch_token(token_endpoint)
access_token = session.token["access_token"]
print(access_token)
请安装Authlib包。https://pypi.org/project/Authlib/
pip install Authlib