Hi! I encountered issues in installing Registration Processor
While following the instruction :
cd topic
./create_topics.sh
there were dependency issues:
rke@mosipv3-vm2:~/mosip-infra/deployment/v3/mosip/regproc/topic$ ./create_topics.sh
Enter IAM username: admin
Creating topics
Traceback (most recent call last):
File “create_topics.py”, line 7, in
import pandas as pd
ModuleNotFoundError: No module named ‘pandas’
i installed pandas sudo apt install python3-pandas then tried again
another dependency issue
ModuleNotFoundError: No module named ‘sqlalchemy’
i installed pyhton 3 sqlalchemy since pandas is using python 3
sudo apt install python3-pip
pip3 install SQLAlchemy
too many errors so I installed python2 version of sqlalchemy and removed python3 version
sudo apt-get install sqlalchemy
another dependency error among others again
ModuleNotFoundError: No module named ‘psycopg2’
I installed pip install psycopg2-binary
still too may errors:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “create_topics.py”, line 36, in
main()
File “create_topics.py”, line 33, in main
upload_xlsx(args.xls, args.user, args.db_user, args.db_pwd, args.db_host, args.db_port)
File “create_topics.py”, line 17, in upload_xlsx
df.to_sql(‘topic’, engine, index=False, if_exists=‘append’)
File “/usr/lib/python3/dist-packages/pandas/core/generic.py”, line 2702, in to_sql
sql.to_sql(
File “/usr/lib/python3/dist-packages/pandas/io/sql.py”, line 509, in to_sql
pandas_sql.to_sql(
File “/usr/lib/python3/dist-packages/pandas/io/sql.py”, line 1319, in to_sql
table.create()
File “/usr/lib/python3/dist-packages/pandas/io/sql.py”, line 641, in create
if self.exists():
File “/usr/lib/python3/dist-packages/pandas/io/sql.py”, line 628, in exists
return self.pd_sql.has_table(self.name, self.schema)
File “/usr/lib/python3/dist-packages/pandas/io/sql.py”, line 1343, in has_table
return self.connectable.run_callable(
File “”, line 2, in run_callable
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py”, line 402, in warned
return fn(*args, **kwargs)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 3223, in run_callable
with self.connect() as conn:
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 3315, in connect
return self._connection_cls(self, close_with_result=close_with_result)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 96, in init
else engine.raw_connection()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 3394, in raw_connection
return self._wrap_pool_connect(self.pool.connect, _connection)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 3364, in _wrap_pool_connect
Connection.handle_dbapi_exception_noconnection(
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 2198, in handle_dbapi_exception_noconnection
util.raise(
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py”, line 208, in raise
raise exception
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py”, line 3361, in _wrap_pool_connect
return fn()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 320, in connect
return _ConnectionFairy._checkout(self)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 884, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 486, in checkout
rec = pool._do_get()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/impl.py”, line 146, in do_get
self.dec_overflow()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py”, line 70, in exit
compat.raise(
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py”, line 208, in raise
raise exception
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/impl.py”, line 143, in _do_get
return self._create_connection()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 266, in _create_connection
return _ConnectionRecord(self)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 381, in init
self.__connect()
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 678, in connect
pool.logger.debug(“Error on connect(): %s”, e)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py”, line 70, in exit
compat.raise(
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py”, line 208, in raise
raise exception
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/pool/base.py”, line 673, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/create.py”, line 578, in connect
return dialect.connect(*cargs, **cparams)
File “/home/rke/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py”, line 598, in connect
return self.dbapi.connect(*cargs, **cparams)
File “/home/rke/.local/lib/python3.8/site-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name “api-internal.x.x.x” to address: System error
In short to avoid these errors, how do I install the dependencies for the create_topic.sh ?