"pip3 install mysqlclient" failing on openSUSE

On Wednesday 5 May I decided to give openSUSE Linux a try, primarily to see how it works, and also to see if I can get QRetail running on it. Aside from having to figure out the YAST2 console interface and use zypper in place of rpm, things went pretty well.

Until I attempted to install mysqlclient using pip install mysqlclient. It failed with the following unexpected error message:

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lz

The problem was the linker was searching for a file named libz.so, but there wasn’t one on the system. There was the following:

suse:/lib64 # ls -l /lib64/libz*
lrwxrwxrwx 1 root root    14 Apr 27 12:41 /lib64/libz.so.1 -> libz.so.1.2.11
-rwxr-xr-x 1 root root 92216 Apr 27 12:41 /lib64/libz.so.1.2.11

All that was needed to fix the problen was create a new symlink:

cd /lib64
ln -s libz.so.1.2.11 libz.so

However, I quickly reverted openSUSE back to CentOS for a couple of reasons:

  • Their build of Midnight Commander can’t do cd sh://<host> to use FISH (file transfer over SSH)
  • A strange interaction between the old version of konsole on my admittedly ancient Fedora and openSUSE’s ncurses produced unreadable output when running QRetail.