vs00452
Posts: 2
Joined: Wed Jul 28, 2021 12:07 am

64-bit-OS/aarch-64/raspberry pi 4 import error

Wed Jul 28, 2021 12:13 am

Hello,

I was trying to run my code on raspberry pi 4 with 64-bit OS i was getting the error :

Traceback (most recent call last):
File "main1.py", line 6, in <module>
from data_loader import organiser
File "/home/pi/Deep_Audio_Net/data_loader/organiser.py", line 6, in <module>
from exp_run import audio_feature_extractor as afe
File "/home/pi/Deep_Audio_Net/exp_run/audio_feature_extractor.py", line 2, in <module>
import librosa
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/__init__.py", line 211, in <module>
from . import core
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/core/__init__.py", line 5, in <module>
from .convert import * # pylint: disable=wildcard-import
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/core/convert.py", line 7, in <module>
from . import notation
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/core/notation.py", line 8, in <module>
from ..util.exceptions import ParameterError
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/util/__init__.py", line 87, in <module>
from ._nnls import * # pylint: disable=wildcard-import
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/librosa/util/_nnls.py", line 13, in <module>
import scipy.optimize
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/scipy/optimize/__init__.py", line 400, in <module>
from .optimize import *
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 36, in <module>
from ._numdiff import approx_derivative
File "/home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/scipy/optimize/_numdiff.py", line 8, in <module>
from ._group_columns import group_dense, group_sparse
ImportError: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/pi/archiconda3/envs/daic/lib/python3.7/site-packages/scipy/optimize/_group_columns.cpython-37m-aarch64-linux-gnu.so)

could someone help me with this, i tried few things but it is not working for me.

Regards,
Singh

Eirikur
Posts: 133
Joined: Sun Sep 09, 2018 9:43 pm

Re: 64-bit-OS/aarch-64/raspberry pi 4 import error

Thu Jul 29, 2021 3:05 am

Conda is a mess, in my opinion. It's dependency management is bad. I have had similar problems! They have not done enough work to make their extremely complex layered dependencies work. Typically, some library in their stack is just a wrapper around a binary library but that dependency is not stated in the Conda packages. Yes, the problem is probably in some library that they didn't write, but they should get those things fixed and push the fix back to developers of the bad library. Bad libraries might simply depend upon binary libraries that are not portable to ARM processors. First advice: Use a virtual environment to isolate your program's dependencies from the python installed "on" the operating system. The venv program is a part of python now, so you don't have to install anything extra, although you might have to explicitly install venv because some flavors of linux split Python up into several packages. There are nicer virtual environment tools, but I don't know which is best or most current. Virtual python environments are not a perfect solution, but they can definitely help you isolate problems.

At the bottom of your problem is this: /lib/aarch64-linux-gnu/libstdc++.so.6 That's the operating system's standard library (contains I/O code, etc) for C++.

Type this to see what version of litstdc++ you actually have: ls -lah /lib/aarch64-linux-gnu/libstdc++*

You could try this command to see what versions you can easily install on Pi OS: dpkg -S libstdc++
It seems that 6 is the current version. If it is not there, try to install it. If using the apt command line is unfamiliar to you, I recommend Synaptic as a decent GUI for the apt package system. Install it with: sudo apt install -y synaptic.
I'm not going to go into how to fake dependencies using symbolic links in the filesystem. I've done it, but I do not recommend doing that kind of thing that can easily break other programs.

So, my real message would have to be: Don't use Conda, they want the credit for having a zillion features, but they get all those features from third parties and they don't even check them out thoroughly.

Given that by bulk, Conda is mostly Numpy and Scipy, I'd recommend using those very well supported libraries directly.

My best,

Eirikur

vs00452
Posts: 2
Joined: Wed Jul 28, 2021 12:07 am

Re: 64-bit-OS/aarch-64/raspberry pi 4 import error

Thu Jul 29, 2021 9:28 am

I was trying with conda because i am not able to install h5py package on Pi using pip.


I typed following command to see the version
root@raspberrypi:~# ls -lah /lib/aarch64-linux-gnu/libstdc++*
lrwxrwxrwx 1 root root 19 Apr 6 2019 /lib/aarch64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.25
-rw-r--r-- 1 root root 1.5M Apr 6 2019 /lib/aarch64-linux-gnu/libstdc++.so.6.0.25

I checked following thing to see the GLIBCXX , so you can see GLIBCXX_3.4.26 is not present.
root@raspberrypi:/lib/aarch64-linux-gnu# strings libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_DEBUG_MESSAGE_LENGTH

then i tried to upgrade libstd using following command
apt-get install libstdc++6
so it is saying it is already newest version
root@raspberrypi:~# apt-get install libstdc++6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libstdc++6 is already the newest version (8.3.0-6).
The following package was automatically installed and is no longer required:
python-colorzero
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Now i am not understanding how i can get the GLIBCXX_3.4.26.

If i will get the h5py installation using pip that will be great for me.

Regards,
Vikas

Return to “General discussion”