我尝试按照
建议安装 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'
[packages]
pyjwt = ">=2.8.0"
requests-oauthlib = ">=1.3.1"
应该可以解决这个问题:
cryptography