All,

I've been trying to build a very simple openbabel example script but 
pyinstaller fails to set environment variables or include plugin data 
causing an error at runtime. 

 .\dist\obopt.exe
==============================
*** Open Babel Error  in OpenBabel::OBPlugin::LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR 
environment variable.
==============================
*** Open Babel Error  in OpenBabel::OBPlugin::LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR 
environment variable.

This is the script I am trying to build:



















*from openbabel import openbabelclass ob:    def read_xyz(file):        
obconversion = openbabel.OBConversion()        
obconversion.SetInAndOutFormats("xyz", "xyz")        mol = 
openbabel.OBMol()        obconversion.ReadFile(mol, file)        return 
mol    def write_xyz(mol,file):        
obff=openbabel.OBForceField.FindForceField("Ghemical")        
obff.Setup(mol)        obff.ConjugateGradients(10000)        
obff.GetCoordinates(mol)        obconversion = openbabel.OBConversion()    
    obconversion.SetInAndOutFormats("xyz", "xyz")        
obconversion.WriteFile(mol, file)mol = ob.read_xyz('test.xyz')*

I found an earlier post attempting to solve this issue 
here: 
https://github.com/ssorgatem/pyinstaller/blob/master/support/rthooks/pyi_rth_obdata.py

I think this adds a new runtime hook in 
C:\Users\RO\Miniconda3\envs\ncapB\lib\site-packages\PyInstaller\hooks\rthooks\

I've also tried to supply the hook at build time with: pyinstaller 
--onefile --runtime-hook=obrth.py .\obopt.py

So far things are still not working. Build works on linux only windows is 
broken. I am running pyinstaller 5.7.0, python 3.10.8, openbabel  3.1.0. 
All installed with miniconda.

Any help would be appreciated.

Thanks,
Richard  

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/1a96b4dc-f751-4565-8330-5e03b946d95fn%40googlegroups.com.

Reply via email to