Hi,
I installed the cf_units module from scratch. This created a libudunits2.so.0 file stored in /home/samhat/udunits2/lib
. In my app directory, my .env
file looks like
LD_LIBRARY_PATH=/home/samhat/udunits2/lib
and in my /var/www/samhat_pythonanywhere_com_wsgi.py
file I have
from dotenv import load_dotenv
project_folder = os.path.expanduser('/home/samhat/app-name')
load_dotenv(os.path.join(project_folder, '.env'))
I am able to view the LD_LIBRARY_PATH
from within the web app, using os.environ
. However, when I try to import cf_units
, I get
ImportError: libudunits2.so.0: cannot open shared object file: No such file or directory
despite the fact that this file definitely exists in the /home/samhat/udunits2/lib
directory. I am able to import the cf_units module from a bash command prompt by manually setting LD_LIBRARY_PATH
, but it doesn't work for the web app itself. Any ideas why the file cannot be resolved despite existing in the linking library path?
Thanks.