Package installation fails after new release v2.2.0 #624
-
Describe the bugHi guys! I cannot seem to install Dropping the stack trace:
I just want to verify if this is related to the new release. |
Beta Was this translation helpful? Give feedback.
Replies: 19 comments 20 replies
-
I can confirm from my testing that 2.1.1 worked fine and 2.2.0 failed to build for me as seen by @pauliuskrispis |
Beta Was this translation helpful? Give feedback.
-
As message said, you need to install pkg-config |
Beta Was this translation helpful? Give feedback.
-
Read #584 |
Beta Was this translation helpful? Give feedback.
-
@methane Alpine Linux doesn't have a |
Beta Was this translation helpful? Give feedback.
-
You should fix it by yourself or alpine community. |
Beta Was this translation helpful? Give feedback.
-
Same issue here, please fix this as soon as possible. Reopen the issue as it is important. Exporting environment variables as a workaround is definitely not proper. |
Beta Was this translation helpful? Give feedback.
-
@methane I've got pkg-config installed, but still mysqlclient >= 2.2.0 fails to install as follows on Ubuntu 22.04 LTS and python 3.10:
|
Beta Was this translation helpful? Give feedback.
-
Got it to work using |
Beta Was this translation helpful? Give feedback.
-
Anyone using MacPorts on macOS - this worked for me (wasn't necessary for < 2.2.0):
|
Beta Was this translation helpful? Give feedback.
-
I use
And I use |
Beta Was this translation helpful? Give feedback.
-
I think I've got the same problem on CentOS 7, installation fails with a log like this: Collecting mysqlclient>=1.4 (from Products.ZMySQLDA->-r https://raw.githubusercontent.com/zms-publishing/ZMS/main/requirements-full.txt (line 8))
Using cached mysqlclient-2.2.0.tar.gz (89 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
Trying pkg-config --exists mysqlclient
Command 'pkg-config --exists mysqlclient' returned non-zero exit status 1.
Trying pkg-config --exists mariadb
Command 'pkg-config --exists mariadb' returned non-zero exit status 1.
Traceback (most recent call last):
File "/home/zope/virtualenv_demo/lib64/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/zope/virtualenv_demo/lib64/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/zope/virtualenv_demo/lib64/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-rbe1z0nv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-rbe1z0nv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-rbe1z0nv/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 154, in <module>
File "<string>", line 48, in get_config_posix
File "<string>", line 27, in find_package_name
Exception: Can not find valid pkg-config name.
Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error As far as I can tell, on CentOS the If I read the other bugs correctly, you switched from Falling back to I'm falling back to the workaround with the environment variables for now, but I'd really like to get rid of that. |
Beta Was this translation helpful? Give feedback.
-
on ubuntu 23 i fixed mine by just installing pkgconf with . |
Beta Was this translation helpful? Give feedback.
-
sudo apt-get install libmysqlclient-dev this worked for me |
Beta Was this translation helpful? Give feedback.
-
The Mysql 8 / percona * doesn't provide pkgconfig file . So just create it . A sample for percona 8 is given below,
Now the following works fines:
|
Beta Was this translation helpful? Give feedback.
-
brew install mysqlclient will help |
Beta Was this translation helpful? Give feedback.
-
Does anyone have a recipe for getting this working on Amazon Linux 2 (i.e. the base image for images like aws-lambda-python) ? I have: FROM public.ecr.aws/lambda/python:3.11-arm64
RUN yum update -y &&\
yum --setopt=skip_missing_names_on_install=False install -y gcc pkgconfig mariadb-devel
RUN find / -name "*.pc"
RUN find / -name "*mariadb*"
RUN find / -name "*mysql*"
ENV PKG_CONFIG_PATH=/usr/lib64/pkgconfig
RUN \
MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mariadb) \
MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mariadb) \
pip install mysqlclient and I get this output:
So I am unable to find a path to use for pkg-config I tried this instead: RUN \
MYSQLCLIENT_LDFLAGS=$(mysql_config --libs) \
MYSQLCLIENT_CFLAGS=$(mysql_config --cflags) \
pip install mysqlclient but then I get a different error:
and FWIW the values output by
anyone got any idea what working values here should be? at the moment the only thing that works for me is pin to previous version |
Beta Was this translation helpful? Give feedback.
-
Thank You
…On Wed, 8 Nov 2023 at 17:49, Paul Garner ***@***.***> wrote:
Does anyone have a recipe for getting this working on Amazon Linux 2 (i.e.
the base image for images like aws-lambda-python) ?
I have:
FROM public.ecr.aws/lambda/python:3.11-arm64
RUN yum update -y &&\
yum --setopt=skip_missing_names_on_install=False install -y gcc pkgconfig mariadb-devel
RUN find / -name "*.pc"RUN find / -name "*mariadb*"RUN find / -name "*mysql*"
ENV PKG_CONFIG_PATH=/usr/lib64/pkgconfig
RUN \
MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mariadb) \
MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mariadb) \
pip install mysqlclient
and I get this output:
#6 [3/5] RUN find / -name "*.pc"
#6 0.297 /usr/share/pkgconfig/shared-mime-info.pc
#6 0.297 /usr/lib64/pkgconfig/libcrypto.pc
#6 0.297 /usr/lib64/pkgconfig/mit-krb5.pc
#6 0.297 /usr/lib64/pkgconfig/libpcre16.pc
#6 0.297 /usr/lib64/pkgconfig/kadm-client.pc
#6 0.297 /usr/lib64/pkgconfig/gssrpc.pc
#6 0.297 /usr/lib64/pkgconfig/krb5.pc
#6 0.297 /usr/lib64/pkgconfig/libssl.pc
#6 0.297 /usr/lib64/pkgconfig/mit-krb5-gssapi.pc
#6 0.297 /usr/lib64/pkgconfig/kdb.pc
#6 0.297 /usr/lib64/pkgconfig/kadm-server.pc
#6 0.297 /usr/lib64/pkgconfig/libsepol.pc
#6 0.297 /usr/lib64/pkgconfig/libselinux.pc
#6 0.297 /usr/lib64/pkgconfig/libpcreposix.pc
#6 0.297 /usr/lib64/pkgconfig/zlib.pc
#6 0.297 /usr/lib64/pkgconfig/libpcre.pc
#6 0.297 /usr/lib64/pkgconfig/openssl.pc
#6 0.297 /usr/lib64/pkgconfig/libpcrecpp.pc
#6 0.297 /usr/lib64/pkgconfig/libpcre32.pc
#6 0.297 /usr/lib64/pkgconfig/krb5-gssapi.pc
#6 0.297 /usr/lib64/pkgconfig/libverto.pc
#6 0.297 /usr/lib64/pkgconfig/com_err.pc
#6 0.297 /var/lang/lib/pkgconfig/python3-embed.pc
#6 0.297 /var/lang/lib/pkgconfig/python3.pc
#6 0.297 /var/lang/lib/pkgconfig/python-3.11-embed.pc
#6 0.297 /var/lang/lib/pkgconfig/python-3.11.pc
#6 DONE 0.3s
#7 [4/5] RUN find / -name "*mariadb*"
#7 0.340 /usr/share/doc/mariadb-libs-5.5.68
#7 0.340 /etc/ld.so.conf.d/mariadb-aarch64.conf
#7 0.340 /var/lib/yum/yumdb/m/e2e13dd7e4a67b5d6902629c9e56bbc75006b79d-mariadb-devel-5.5.68-1.amzn2.0.1-aarch64
#7 0.340 /var/lib/yum/yumdb/m/e4ee6d3d8a6acf586ecb757a24cfaced11ad5454-mariadb-libs-5.5.68-1.amzn2.0.1-aarch64
#7 DONE 0.4s
#8 [5/6] RUN find / -name "*mysql*"
#8 0.283 /usr/include/mysql
#8 0.283 /usr/include/mysql/mysql_embed.h
#8 0.283 /usr/include/mysql/mysql.h
#8 0.283 /usr/include/mysql/psi/mysql_file.h
#8 0.283 /usr/include/mysql/psi/mysql_thread.h
#8 0.283 /usr/include/mysql/mysqld_error.h
#8 0.283 /usr/include/mysql/mysql_com.h
#8 0.283 /usr/include/mysql/mysqld_ername.h
#8 0.283 /usr/include/mysql/mysql_time.h
#8 0.283 /usr/include/mysql/private/mysqld_suffix.h
#8 0.283 /usr/include/mysql/private/mysqld_default_groups.h
#8 0.283 /usr/include/mysql/private/probes_mysql_nodtrace.h
#8 0.283 /usr/include/mysql/private/mysqld.h
#8 0.283 /usr/include/mysql/private/probes_mysql.h
#8 0.283 /usr/include/mysql/private/mysql_async.h
#8 0.283 /usr/include/mysql/private/probes_mysql_dtrace.h
#8 0.283 /usr/include/mysql/mysql_version.h
#8 0.283 /usr/share/man/man1/mysql_config.1.gz
#8 0.283 /usr/share/aclocal/mysql.m4
#8 0.283 /usr/share/doc/mariadb-libs-5.5.68/README.mysql-license
#8 0.283 /usr/share/mysql
#8 0.283 /usr/lib64/mysql
#8 0.283 /usr/lib64/mysql/libmysqlclient_r.so
#8 0.283 /usr/lib64/mysql/mysql_config
#8 0.283 /usr/lib64/mysql/plugin/mysql_clear_password.so
#8 0.283 /usr/lib64/mysql/libmysqlclient.so
#8 0.283 /usr/lib64/mysql/libmysqlclient.so.18
#8 0.283 /usr/lib64/mysql/libmysqlclient.so.18.0.0
#8 0.283 /usr/bin/mysql_config
#8 0.283 /etc/alternatives/mysql_config
#8 0.283 /etc/my.cnf.d/mysql-clients.cnf
#8 0.283 /var/lib/alternatives/mysql_config
#8 DONE 0.3s
#9 [5/5] RUN MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mariadb) MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mariadb) pip install mysqlclient
#9 0.212 Package mariadb was not found in the pkg-config search path.
#9 0.212 Perhaps you should add the directory containing `mariadb.pc'
#9 0.212 to the PKG_CONFIG_PATH environment variable
#9 0.212 No package 'mariadb' found
#9 0.214 Package mariadb was not found in the pkg-config search path.
#9 0.214 Perhaps you should add the directory containing `mariadb.pc'
#9 0.214 to the PKG_CONFIG_PATH environment variable
#9 0.214 No package 'mariadb' found
So I am unable to find a path to use for pkg-config
I tried this instead:
RUN \
MYSQLCLIENT_LDFLAGS=$(mysql_config --libs) \
MYSQLCLIENT_CFLAGS=$(mysql_config --cflags) \
pip install mysqlclient
but then I get a different error:
#6 7.921 gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-Dversion_info=(2, 2, 0, 'final', 0)" -D__version__=2.2.0 -I/var/lang/include/python3.11 -c src/MySQLdb/_mysql.c -o build/temp.linux-aarch64-cpython-311/src/MySQLdb/_mysql.o -I/usr/include/mysql -std=c99
#6 7.921 In file included from /var/lang/include/python3.11/Python.h:12:0,
#6 7.921 from src/MySQLdb/_mysql.c:46:
#6 7.921 /var/lang/include/python3.11/pyconfig.h:1787:0: warning: "_POSIX_C_SOURCE" redefined
#6 7.921 #define _POSIX_C_SOURCE 200809L
#6 7.921
#6 7.921 In file included from /usr/include/sys/types.h:25:0,
#6 7.921 from /usr/include/mysql/mysql.h:49,
#6 7.921 from src/MySQLdb/_mysql.c:29:
#6 7.921 /usr/include/features.h:289:0: note: this is the location of the previous definition
#6 7.921 # define _POSIX_C_SOURCE 199506L
#6 7.921
#6 7.921 src/MySQLdb/_mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
#6 7.921 src/MySQLdb/_mysql.c:536:13: warning: implicit declaration of function ‘mysql_optionsv’; did you mean ‘mysql_options’? [-Wimplicit-function-declaration]
#6 7.921 mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
#6 7.921 ^~~~~~~~~~~~~~
#6 7.921 mysql_options
#6 7.921 src/MySQLdb/_mysql.c:536:49: error: ‘MYSQL_OPT_SSL_ENFORCE’ undeclared (first use in this function); did you mean ‘MYSQL_OPT_LOCAL_INFILE’?
#6 7.921 mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
#6 7.921 ^~~~~~~~~~~~~~~~~~~~~
#6 7.921 MYSQL_OPT_LOCAL_INFILE
#6 7.921 src/MySQLdb/_mysql.c:536:49: note: each undeclared identifier is reported only once for each function it appears in
#6 7.921 error: command '/usr/bin/gcc' failed with exit code 1
#6 7.921 [end of output]
and FWIW the values output by mysql_config are:
#6 [3/5] RUN mysql_config --libs
#6 0.169 -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto
#6 DONE 0.2s
#7 [4/5] RUN mysql_config --cflags
#7 0.229 -I/usr/include/mysql
#7 DONE 0.2s
anyone got any idea what working values here should be?
—
Reply to this email directly, view it on GitHub
<#624 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BABQ53ZZVMBPPV7PYZUH4EDYDN2FJAVCNFSM6AAAAAAZQKM4KSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKMBZHEYTS>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You're welcome!
…On Wed, 8 Nov 2023 at 21:34, Paul Garner ***@***.***> wrote:
Thank you, that worked 👍
—
Reply to this email directly, view it on GitHub
<#624 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BABQ537S7XDPD5K27SN3FYDYDOUR3AVCNFSM6AAAAAAZQKM4KSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKMJSGUYTA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Alpine version Dockerfile (if anyone needs this): FROM python:3.12-alpine
RUN apk add --no-cache pkgconf build-base mariadb-dev \
&& pip install --no-cache-dir mysqlclient \
&& apk del build-base pkgconf |
Beta Was this translation helpful? Give feedback.
Got it to work using
pkgconfig mariadb-dev
for Alpine.