OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
85 stars 48 forks source link

mysqlclient install error #27

Open bshirazi opened 5 years ago

bshirazi commented 5 years ago

Hi I am installing opensips-cli on debian 9 and already installed mysql and opensips. I done installation according procedure but when installing mysqlclient I see this errors:

`` Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz Complete output from command python setup.py egg_info: /bin/sh: 1: mysql_config: not found /bin/sh: 1: mariadb_config: not found /bin/sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-x6068whh/mysqlclient/setup.py", line 16, in metadata, options = get_config() File "/tmp/pip-build-x6068whh/mysqlclient/setup_posix.py", line 61, in get_config libs = mysql_config("libs") File "/tmp/pip-build-x6068whh/mysqlclient/setup_posix.py", line 29, in mysql_config raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-x6068whh/mysqlclient/``

razvancrainea commented 4 years ago

Could you please try again? I've just pushed a fix for this.

bshirazi commented 4 years ago

Hi The above problems still exits but I solve it according to Gmaruzz suggestion with installing: apt-get install default-libmysqlclient-dev and another problem for me after running: python3 setup.py install clean install script stalls in: Searching for sqlalchemy==1.3.3 Reading https://pypi.python.org/simple/sqlalchemy/ .. again according to Gmaruzz suggestion I comment out line 68 and 69 in setup.py

'mysqlclient<1.4.0rc1',

'sqlalchemy==1.3.3',

So it seems everythig is ok now.

Regards M.Shirazi

spacetourist commented 4 years ago

Apologies, missed this when adding my pull request #30 - my installation was on CentOS, I'll amend with this package for Debian

bshirazi commented 4 years ago

Hi I tried again. for Ubuntu it is ok but for debian it again stops in: Searching for sqlalchemy==1.3.3 Reading https://pypi.python.org/simple/sqlalchemy/

for solving this according to @gmaruzz suggestion I comment line 68 and 69 in setup.py Regards

sdwru commented 4 years ago

This issue is several months old and apparently still has not been fixed. The work around by commenting out lines 68/69 worked for me. It would be nice if there was a DEB package for this like there is for opensips-console.

liviuchircu commented 4 years ago

@sdwru @nikbyte added Ubuntu/Debian packaging for opensips-cli, so that should solve all of your install issues. However, I suggest we keep this issue open until we find some time to reproduce the Debian 9 issues and correct them via setup.py install as well.

LE: forgot to link the opensips-cli package repository

bbslucky commented 2 months ago

...is it still alive? i build it on openeuler 24.03, when i run opensip-cli -d command DEBUG: no config file found in any of /root/.opensips-cli.cfg, /usrlocal/opensips/etc/opensips-cli.cfg, /usrlocal/opensips/etc/opensips/opensips-cli.cfg INFO: no config file used! DEBUG: fifo file /tmp/opensips_fifo does not exist! Welcome to OpenSIPS Command Line Interface! Traceback (most recent call last): File "/usr/local/bin/opensips-cli", line 4, in import('pkg_resources').run_script('opensipscli==0.2.0', 'opensips-cli') File "/usr/local/lib/python3.11/site-packages/pkg_resources/init.py", line 720, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/local/lib/python3.11/site-packages/pkg_resources/init.py", line 1559, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/EGG-INFO/scripts/opensips-cli", line 9, in run_console() File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console main.main() File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/opensipscli/main.py", line 77, in main shell = cli.OpenSIPSCLI(args) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/opensipscli/cli.py", line 90, in init self.update_instance(cfg.current_instance) File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/opensipscli/cli.py", line 166, in update_instance excl_mod = mod.exclude(mod) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/opensipscli/modules/database.py", line 468, in exclude return (not osdb.has_dialect(osdb.get_dialect(db_url)), None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/opensipscli-0.2.0-py3.11.egg/opensipscli/db.py", line 765, in has_dialect sqlalchemy.create_engine('{}://'.format(dialect)) File "/usr/local/lib64/python3.11/site-packages/sqlalchemy/engine/init.py", line 435, in create_engine return strategy.create(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib64/python3.11/site-packages/sqlalchemy/engine/strategies.py", line 87, in create dbapi = dialect_cls.dbapi(dbapi_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib64/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi return import("MySQLdb") ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib64/python3.11/site-packages/MySQLdb/init.py", line 18, in import _mysql ImportError: /usr/local/lib64/python3.11/site-packages/_mysql.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZTVN10cxxabiv117class_type_infoE

i just want run opensips-cli -o database_schema_path=/usr/local/opensips/share/opensips/mysql -o database_url=mysql://opensips:opensipspwd@localhost -o database_modules=ALL -x database create to create databases

bbslucky commented 2 months ago

it's maybe the python2 and python3 is not fix MySQLdb is for python2,not for python3