I'm trying to implement running machine learning on my web. I set my Xampp addhandler .py so that can handle python files. Basically, I checked everything python works on my web. But the problem is that cannot import any libraries such as cv2, easyocr, and imutils.
# !C:\Users\parkc\AppData\Local\Programs\Python\Python310\python.exe
print("Content-type: text/html\n")
import cv2
import numpy as np
import imutils
import easyocr
from matplotlib import pyplot as plt
print("Hello World")
And this is my result page, result page Nothing shows. So, what I doubt is that it can't load libraries from localhost. Because if I set the code like,
# !C:\Users\parkc\AppData\Local\Programs\Python\Python310\python.exe
print("Content-type: text/html\n")
print("Hello World")
import cv2
import numpy as np
import imutils
import easyocr
from matplotlib import pyplot as plt
Then, it prints Hello World very well! I'm googling for 2 days to solve this problem. But totally cannot get what's the problem. Is it not possible to use package libraries on web? My web server is Apache Xampp.
1条答案
按热度按时间ohtdti5x1#
Maybe you would like to read this, it will help you a lot I think: the article
“How to Easily Run Python Visualizations On a Web Browser with PyScript”