Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RayXu14 opened this issue Aug 4, 2018 · 1 comment
Open

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

RayXu14 opened this issue Aug 4, 2018 · 1 comment

Comments

@RayXu14
Copy link

RayXu14 commented Aug 4, 2018

{
"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))
@qiangruoyu
Copy link

I meet the same error.how you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants