ModuleNotFoundError: No module named ‘psycopg2’
Traceback:
File "/root/miniconda/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.__dict__)File "/root/temp-data/app1.py", line 25, in <module>
import calculations as calcFile "/root/temp-data/calculations.py", line 2, in <module>
from data_pipe import fetcher as live_dpFile "/root/temp-data/data_pipe/fetcher.py", line 3, in <module>
import psycopg2
this is my requirement file
numpy
pandas
plotly
matplotlib
wordcloud
datetime
numerize
elasticsearch
pycountry
yake
configparser
langdetect
spacy
i tried to install it manually but still the same issue
any help will be much appreciated
1 Like
Hi @sujata_g,
Thanks for posting and welcome to Streamlit Community Forum! 
Check out this solution from a similar question.
Use psycopg2-binary
in your requirements.txt instead of psycopg2
.
I hope this helps.
thank u for the help but now i ended up with diff error
File "/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.__dict__)File "/app/app1.py", line 25, in <module>
import searcher as s1File "/venv/lib/python3.9/site-packages/searcher/__init__.py", line 1, in <module>
from .search import SolrEngineFile "/venv/lib/python3.9/site-packages/searcher/search.py", line 22, in <module>
class SolrEngine(BaseSearchEngine):File "/venv/lib/python3.9/site-packages/searcher/search.py", line 25, in SolrEngine
session: ClientSession = ClientSession()File "/venv/lib/python3.9/site-packages/aiohttp/client.py", line 228, in __init__
loop = get_running_loop(loop)File "/venv/lib/python3.9/site-packages/aiohttp/helpers.py", line 288, in get_running_loop
loop = asyncio.get_event_loop()File "/usr/local/lib/python3.9/asyncio/events.py", line 642, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'