AttributeError:模块“jwt.algorithms”没有属性“hashes”

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

我尝试按照

建议
安装 pyjwt 在 Python 虚拟环境中运行以下脚本,并且它有效 pip3 install -U pyjwt

但是,当我尝试运行本地 Docker 映像时,它会抛出错误

import requests from requests_oauthlib import OAuth1 from oauthlib.oauth1 import SIGNATURE_RSA headerauth = OAuth1(client_key, rsa_key, signature_type="auth_header", signature_method=SIGNATURE_RSA) r = requests.get(url, auth=headerauth)

Pipfile中注明的版本与Python虚拟环境中的版本相同

AttributeError: module 'jwt.algorithms' has no attribute 'hashes'


python docker pip jwt attributeerror
1个回答
1
投票
[packages] pyjwt = ">=2.8.0" requests-oauthlib = ">=1.3.1"

应该可以解决这个问题:

cryptography

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