I have installed tensorflow_hub package in python 3.6. The package can be imported correctly when I test it in python console. However, when I use it in a cgi-script an error occurs:
no module named tensorflow_hub
Source Code
#!/usr/bin/python3.6
import sys
import cgitb
import cgi
t = ''
try:
import tensorflow_hub as tf
except Exception as e:
t = str(e)
cgitb.enable()
sys.stdout.write("Content-Type: application/json")
sys.stdout.write("\n")
sys.stdout.write("\n")
result = dict()
result['data'] = t
sys.stdout.write(json.dumps(result,indent=1))
sys.stdout.write("\n")
Could you explain me which is the problem? I tested other packages (e.g. tensorflow) but I hadn't any issue.
Edit
To install the package:
pip3 install tensorflow-hub
which pip3
/usr/bin/pip3