linux下python3.7运行报错cannot open shared object file: No such file or directory
Yumaofei opened this issue · 1 comments
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/datafaker/cli.py", line 90, in main
db = load_db_class(args.dbtype)(args)
File "/usr/local/lib/python3.7/site-packages/datafaker/dbs/basedb.py", line 40, in init
self.init()
File "/usr/local/lib/python3.7/site-packages/datafaker/dbs/rdbdb.py", line 11, in init
self.session = load_sqlalchemy(self.args.connect)
File "/usr/local/lib/python3.7/site-packages/datafaker/drivers.py", line 14, in load_sqlalchemy
engine = create_engine(connet, pool_recycle=1800)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/init.py", line 456, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi
return import("MySQLdb")
File "/usr/local/lib/python3.7/site-packages/MySQLdb/init.py", line 19, in
import _mysql
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
libmysqlclient.so.20: cannot open shared object file: No such file or directory
问题已解决,我使用的python版本为自装的py3,libmysqlclient.so.20在系统的py2中没有,
find / | grep libmysqlclient.so.20 然后软连接到 /usr/lib64中即可。