In my project I need to use django-libsass..
Libraries(django-libsass and libsass) have installed correctly.
Everything works fine on locally but not when deploying to web server.
On the production server the app is dockerized. The project is build successfully with requirements and their dependencies.
When I try to test libsass on the prod. server from the Django shell,
>>> import sass
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/sass.py", line 26, in <module>
import _sass
ImportError: Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/lib/python3.8/site-packages/_sass.abi3.so)
In the gcc gnu online docs, there is a such info about that error,
This doesn’t mean that the shared library isn’t installed, only that the dynamic linker can’t find it. When a dynamically-linked executable is run the linker finds and loads the required shared libraries by searching a pre-configured list of directories. If the directory where you’ve installed libstdc++ is not in this list then the libraries won’t be found.
To fix this is I tried to use the LD_LIBRARY_PATH environment variable.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
But, python/django app does not notify that environment variable when I simply add it.
My questions:
If setting LD_LIBRARY_PATH is the solution, how can I achieve this?
or Is there any other proper solution to fix that error?