OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

pip install mysqlclient fails with "call to undeclared function" error

  • Thread starter Thread starter Avishek De
  • Start date Start date
A

Avishek De

Guest
I am currently on macOS 14.3 on Apple silicon. I am trying to install mysqlclient using pip. I already have mysql package installed using brew install mysql pkg-config but my mysqlclient installation is failing due to the errors mentioned below:

I am trying to run pip install mysqlclient

I am getting the following error:

Code:
  building 'MySQLdb._mysql' extension
      creating build/temp.macosx-14.1-arm64-cpython-311
      creating build/temp.macosx-14.1-arm64-cpython-311/src
      creating build/temp.macosx-14.1-arm64-cpython-311/src/MySQLdb
      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/opt/mysql-client/include "-Dversion_info=(2, 2, 1, 'final', 0)" -D__version__=2.2.1 -I/Users/avishekde/.pyenv/versions/3.11.6/include/python3.11 -c src/MySQLdb/_mysql.c -o build/temp.macosx-14.1-arm64-cpython-311/src/MySQLdb/_mysql.o -I/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql -std=c99
      src/MySQLdb/_mysql.c:527:9: error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);
              ^
      src/MySQLdb/_mysql.c:527:9: note: did you mean 'mysql_close'?
      /opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql/mysql.h:797:14: note: 'mysql_close' declared here
      void STDCALL mysql_close(MYSQL *sock);
                   ^
      src/MySQLdb/_mysql.c:1795:9: error: call to undeclared function 'mysql_kill'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
          r = mysql_kill(&(self->connection), pid);
              ^
      src/MySQLdb/_mysql.c:1795:9: note: did you mean 'mysql_ping'?
      /opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql/mysql.h:525:13: note: 'mysql_ping' declared here
      int STDCALL mysql_ping(MYSQL *mysql);
                  ^
      src/MySQLdb/_mysql.c:2011:9: error: call to undeclared function 'mysql_shutdown'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
          r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);
              ^
      3 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mysqlclient
Failed to build mysqlclient
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects

The following is the output from pkg-config --cflags --libs mysqlclient

Code:
-I/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql -L/opt/homebrew/Cellar/mysql-client/8.3.0/lib -lmysqlclient
<p>I am currently on macOS 14.3 on Apple silicon. I am trying to install mysqlclient using pip. I already have mysql package installed using <code>brew install mysql pkg-config</code> but my mysqlclient installation is failing due to the errors mentioned below:</p>
<p>I am trying to run <code>pip install mysqlclient</code></p>
<p>I am getting the following error:</p>
<pre><code> building 'MySQLdb._mysql' extension
creating build/temp.macosx-14.1-arm64-cpython-311
creating build/temp.macosx-14.1-arm64-cpython-311/src
creating build/temp.macosx-14.1-arm64-cpython-311/src/MySQLdb
clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/opt/mysql-client/include "-Dversion_info=(2, 2, 1, 'final', 0)" -D__version__=2.2.1 -I/Users/avishekde/.pyenv/versions/3.11.6/include/python3.11 -c src/MySQLdb/_mysql.c -o build/temp.macosx-14.1-arm64-cpython-311/src/MySQLdb/_mysql.o -I/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql -std=c99
src/MySQLdb/_mysql.c:527:9: error: call to undeclared function 'mysql_ssl_set'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);
^
src/MySQLdb/_mysql.c:527:9: note: did you mean 'mysql_close'?
/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql/mysql.h:797:14: note: 'mysql_close' declared here
void STDCALL mysql_close(MYSQL *sock);
^
src/MySQLdb/_mysql.c:1795:9: error: call to undeclared function 'mysql_kill'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
r = mysql_kill(&(self->connection), pid);
^
src/MySQLdb/_mysql.c:1795:9: note: did you mean 'mysql_ping'?
/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql/mysql.h:525:13: note: 'mysql_ping' declared here
int STDCALL mysql_ping(MYSQL *mysql);
^
src/MySQLdb/_mysql.c:2011:9: error: call to undeclared function 'mysql_shutdown'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);
^
3 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Failed to build mysqlclient
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
</code></pre>
<p>The following is the output from <code>pkg-config --cflags --libs mysqlclient</code></p>
<pre><code>-I/opt/homebrew/Cellar/mysql-client/8.3.0/include/mysql -L/opt/homebrew/Cellar/mysql-client/8.3.0/lib -lmysqlclient
</code></pre>
 

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top