python image library PIL on heroku doesn't work - python-imaging-library

I'm really not sure it's PIL's problem or not. But guessing from it works on local and below error massages, I thought heroku or PIL make trouble.
2020-07-04T10:48:48.751781+00:00 app[web.1]: pytesseract.pytesseract.TesseractError: (127, 'tesseract: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory')
and this is my code
import pytesseract
import io
import requests
from PIL import Image
response = requests.get("https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Tesseract_v3.02.png/500px-Tesseract_v3.02.png")
image_bytes = io.BytesIO(response.content)
img = Image.open(image_bytes)
pytesseract.pytesseract.tesseract_cmd = 'tesseract'
t = pytesseract.image_to_string(img)
print(t)

Related

Whisper Open Ai Got Stuck

import whisper
import os
model = whisper.load_model("medium")
print("Sarted")
result = model.transcribe(os.path.join("samples","speech.mp3"),fp16=False)
print(result["text"])
You can find your API key on https://replicate.com
(Whisper_api) prasun#prasun-Latitude-5400:~/Documents/Projects/whisper-main$ python3 Api.py
Sarted
Getting stuck with no output

Having Problem in TensorFlow-Tutorials-Image segmentation

I'm using a jupyter notebook.
I followed the code below and entered it.
pip install git+https://github.com/tensorflow/examples.git
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow_examples.models.pix2pix import pix2pix
from IPython.display import clear_output
import matplotlib.pyplot as plt
And I tried to "Download the Oxford-IIIT Pets dataset"
dataset, info = tfds.load('oxford_iiit_pet:3.*.*', with_info=True)
However, in the console, printed this
Downloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to ~\tensorflow_datasets\mnist\3.0.1...
and there was no data in the folder created.
Why isn't it working?
Tutorial link:https://www.tensorflow.org/tutorials/images/segmentation

UnicodeDecodeError on Import Packages statement in Jupyter Notebook

I'm simply trying to import libraries, e.g.:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
and getting this "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 3200: invalid start byte" error.
I'm new to Jupyter Notebooks and wondering if I didn't set something up correctly. I'm attaching the full error message I'm getting.
Any advice would be GREATLY appreciated.
Error Message Here

Extending bokeh with coffeescript: fails to import libraries

I'm trying to add to a back end project a special bokeh chart. I used this link to do that. Now I have custom.py file:
from bokeh.models import Renderer
from bokeh.util.compiler import FromFile
class CustomRenderer(Renderer):
__implementation__ = FromFile("path_to_file/custom.coffee")
print __implementation__.code
...
and custom.coffee file:
import {Renderer, RendererView} from "models/renderers/renderer"
...
When I launch bokeh server - a page opens in browser with '500: Internal Server Error'. And I don't know why that happens.
Thanks for any help!

import error: Django Running in terminal works but not in eclipse IDE

from django.http import HttpResponse
import urllib2
import simplejson
import memcache
def epghome(request):
mc=memcache.Client(['localhost:11211'])
if mc.get("jsondata"):
myval=mc.get("jsondata")
return HttpResponse("<h1>This Data is coming from Cache :</h1><br> " + str(myval))
else:
responseFromIDubba = ""
responseFromIDubba = urllib2.urlopen("http://www.idubba.com/apps/guide.aspx?key=4e2b0ca2328e03acce0014101d302ac7&type=1&f1=1&f2=0&channel=&gener=&page=0&summary=1").read()
parseResponseString = simplejson.loads(responseFromIDubba)
print(parseResponseString)
body=""
for data in parseResponseString["data"]:
#for keys in data:
#body=body+str(data .items())+".."+str(data[str(keys)])+"<br>"
body=body+str(data.items())+"<br><br>"
#body=body+"<br><br>"
mc.set("epgdata3",body)
mc.set("jsondata",responseFromIDubba)
returndata=str(mc.get("jsondata"))
return HttpResponse("<h1>No Cache Set</h1>" + responseFromIDubba)
Hi, This code is working if I run it in the terminal Python, without any error.
But in ECLIPSE IDE it always gives Import Error.
Even if I downloaded and install those modules. Also, and I restarted both Eclipse and my system, but it won't help.
Can you please suggest me a site where I get all libraries at once ?