No Module named imagehash

getting this error while deployment even thogh imagehash has been installed and is working

ModuleNotFoundError: No module named 'imagehash'
2023-04-14 08:43:29.437 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/app/test/streamlitApp.py", line 3, in <module>
    import imagehash
ModuleNotFoundError: No module named 'imagehash'

https://discuss.streamlit.io/t/using-streamlit-how-to-post-a-question-in-the-streamlit-forum/30960

please just give the solution …ive been working on this for long

please just provide sufficient information…

1 Like

when im running it on my system its running fine, but when im trying to deploy it it gives the no module error. i have this code file and ey.png in my repository

heres the code:
import streamlit as st
from PIL import Image
import imagehash

img1= Image.open(‘ey.png’)

hash = imagehash.average_hash(img1)
st.write(hash)

Did you provide a requirements.txt file?
https://docs.streamlit.io/streamlit-community-cloud/get-started/deploy-an-app/app-dependencies

i had provided it but that gave some other error. i ran this same code without imagehash and without requirements.txt and it got deployed fine. so i removed the requirements.txt. the issue is in the imagehash module

This will not work since imagehash is an external library, you have to provide a requirements.txt file.

when im including the requirements.txt file, it gives some other error

Then it contains probably a lot of unnecessary or non-installable packages.
Please share a link to your public github repo, otherwise we are poking around in the dark.

1 Like

This screenshot does not provide any useful information…

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.