Ubuntu18.04 upgrades GLIBC_2.29, solving ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29'

problem analysis

When I use the transformers environment (Ubuntu 18.04), I get the following error:

ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29’ not found (required by /home/xxxx/anaconda3/envs/xxxx/lib/python3.6/site-packages/tokenizers/tokenizers.cpython-36m-x86_64-linux-gnu.so)

Analyzing the above error report, the tokenizers of the new version of transformers require GLIBC version 2.29

To view the current version of the server, the command is as follows:

strings /lib/x86_64-linux-gnu/libm.so.6 | grep GLIBC_

The returned results are as follows:

GLIBC_2.2.5
GLIBC_2.4
GLIBC_2.15
GLIBC_2.18
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_PRIVATE

It means that the server currently does not have GLIBC_2.29

Install GLIBC_2.29

download

Download using the following command:

cd /usr/local
wget http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz

Higher versions can be downloaded from the Index of /pub/gnu/glibc .

Enter super administrator mode

Enter the following command and then run the password

sudo su

The following commands need to be executed in administrator mode

Unzip and configure

Use the following command to decompress and enter glibc-2.29 to create a build directory

tar -zxvf glibc-2.29.tar.gz
cd glibc-2.29
mkdir build
cd build/
../configure --prefix=/usr/local --disable-sanity-checks


或者

tar -zxvf glibc-2.29.tar.gz
sudo apt-get install gawk
 
…/configure --prefix=/usr/local/glibc
make -j8
sudo make install

Among the above commands, --disable-sanity-checksit plays a key role!

Install

Run the following commands respectively

make -j18
make install

After the installation is successful, you will probably return to the interface as shown below. If no error is reported, it means the installation is successful!
Insert image description here

Establish soft connection

Use the following command to check /lib/x86_64-linux-gnu/libm.so.6the connection status:

cd /lib/x86_64-linux-gnu
ll
  1. cd /lib/x86_64-linux-gnu

  2. ln -s /usr/local/glibc/lib/libm-2.29.so libm.so.6

  3. //The error ln: failed to create symbolic link 'libm.so.6': File exists

  4. //A forced connection is required at this time

  5. sudo ln -sf /usr/local/glibc/lib/libm-2.29.so libm.so.6

In the returned results, you can see /lib/x86_64-linux-gnu/libm.so.6the soft connection to libm-2.27.so.
Insert image description here
Since it was set during the previous configuration, --prefix=/usr/localit libm-2.29.sois installed in /usr/local/libthe location. We can libm-2.29.socopy the file to /lib/x86_64-linux-gnuthe following:

cp /usr/local/lib/libm-2.29.so /lib/x86_64-linux-gnu/

Make a forced soft connection:

ln -sf libm-2.29.so libm.so.6

View Results:

strings /lib/x86_64-linux-gnu/libm.so.6 | grep GLIBC_

Guess you like

Origin blog.csdn.net/weixin_46587777/article/details/131099068