Skip to content

error while 'python python/test.py images/algebra.jpg' #5

@RayXu14

Description

@RayXu14

{
"error": "Invalid credentials",
"error_info": {
"id": "http_unauthorized",
"message": "Invalid credentials"
}
}

what does this means?
I use python3.6, so my code is

#!/usr/bin/env python
import sys
import base64
import requests
import json

file_path = sys.argv[1]
image_uri = "data:image/jpg;base64," + base64.b64encode(open(file_path, "rb").read()).decode()
r = requests.post("https://api.mathpix.com/v3/latex",
    data=json.dumps({'src': image_uri,
        'formats': ['latex_normal', 'latex_styled']}),
    headers={"app_id": "trial", "app_key": "34f1a4cea0eaca8540c95908b4dc84ab",
        "Content-type": "application/json"})
print(json.dumps(json.loads(r.text), indent=4, sort_keys=True))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions