Problems similar to this have been asked, but I've not seen an answer.
In my case I'm trying to pip install openbabel but it's failing.
I have a dockerfile like this:
FROM python:3.10.12-slim-bullseye
RUN apt-get update && apt-get -y install gcc swig &&\
apt-get clean
RUN pip install openbabel==3.1.1.1
Running this generates this error:
Sending build context to Docker daemon 50.4MB
Step 1/3 : FROM python:3.10.12-slim-bullseye
---> 00e023604615
Step 2/3 : RUN apt-get update && apt-get -y install gcc swig && apt-get
clean
---> Using cache
---> 1c4ea5b6e7a6
Step 3/3 : RUN pip install openbabel==3.1.1.1
---> Running in 8ec19781b2b5
Collecting openbabel==3.1.1.1
Downloading openbabel-3.1.1.1.tar.gz (82 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.8/82.8 kB 849.1 kB/s eta
0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: openbabel
Building wheel for openbabel (setup.py): started
Building wheel for openbabel (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [66 lines of output]
running bdist_wheel
running build
running build_ext
Warning: invalid version number '3.1.1.1'.
Guessing Open Babel location:
- include_dirs: ['/usr/local/include/python3.10',
'/usr/local/include/openbabel3']
- library_dirs: ['/usr/local/lib', '/usr/local/lib']
building 'openbabel._openbabel' extension
swigging openbabel/openbabel-python.i to
openbabel/openbabel-python_wrap.cpp
swig -python -c++ -small -O -templatereduce -naturalvar
-I/usr/local/include/python3.10 -I/usr/local/include/openbabel3 -o
openbabel/openbabel-python_wrap.cpp openbabel/openbabel-python.i
openbabel/openbabel-python.i:246: Error: Unable to find
'openbabel/babelconfig.h'
openbabel/openbabel-python.i:248: Error: Unable to find
'openbabel/data.h'
openbabel/openbabel-python.i:249: Error: Unable to find
'openbabel/obutil.h'
openbabel/openbabel-python.i:250: Error: Unable to find
'openbabel/math/vector3.h'
openbabel/openbabel-python.i:252: Error: Unable to find
'openbabel/math/matrix3x3.h'
openbabel/openbabel-python.i:253: Error: Unable to find
'openbabel/math/transform3d.h'
openbabel/openbabel-python.i:254: Error: Unable to find
'openbabel/math/spacegroup.h'
openbabel/openbabel-python.i:256: Error: Unable to find
'openbabel/bitvec.h'
openbabel/openbabel-python.i:260: Error: Unable to find
'openbabel/base.h'
openbabel/openbabel-python.i:262: Error: Unable to find
'openbabel/generic.h'
openbabel/openbabel-python.i:265: Error: Unable to find
'openbabel/griddata.h'
openbabel/openbabel-python.i:267: Error: Unable to find
'openbabel/chains.h'
openbabel/openbabel-python.i:268: Error: Unable to find
'openbabel/typer.h'
openbabel/openbabel-python.i:276: Error: Unable to find
'openbabel/plugin.h'
openbabel/openbabel-python.i:281: Error: Unable to find
'openbabel/oberror.h'
openbabel/openbabel-python.i:282: Error: Unable to find
'openbabel/format.h'
openbabel/openbabel-python.i:283: Error: Unable to find
'openbabel/obconversion.h'
openbabel/openbabel-python.i:284: Error: Unable to find
'openbabel/obfunctions.h'
openbabel/openbabel-python.i:295: Error: Unable to find
'openbabel/elements.h'
openbabel/openbabel-python.i:296: Error: Unable to find
'openbabel/residue.h'
openbabel/openbabel-python.i:297: Error: Unable to find
'openbabel/internalcoord.h'
openbabel/openbabel-python.i:298: Error: Unable to find
'openbabel/atom.h'
openbabel/openbabel-python.i:299: Error: Unable to find
'openbabel/bond.h'
openbabel/openbabel-python.i:300: Error: Unable to find
'openbabel/reaction.h'
openbabel/openbabel-python.i:301: Error: Unable to find
'openbabel/reactionfacade.h'
openbabel/openbabel-python.i:319: Error: Unable to find
'openbabel/mol.h'
openbabel/openbabel-python.i:326: Error: Unable to find
'openbabel/ring.h'
openbabel/openbabel-python.i:327: Error: Unable to find
'openbabel/parsmart.h'
openbabel/openbabel-python.i:328: Error: Unable to find
'openbabel/alias.h'
openbabel/openbabel-python.i:330: Error: Unable to find
'openbabel/fingerprint.h'
openbabel/openbabel-python.i:332: Error: Unable to find
'openbabel/descriptor.h'
openbabel/openbabel-python.i:343: Error: Unable to find
'openbabel/forcefield.h'
openbabel/openbabel-python.i:345: Error: Unable to find
'openbabel/builder.h'
openbabel/openbabel-python.i:346: Error: Unable to find
'openbabel/op.h'
openbabel/openbabel-python.i:348: Error: Unable to find
'openbabel/chargemodel.h'
openbabel/openbabel-python.i:351: Error: Unable to find
'openbabel/phmodel.h'
openbabel/openbabel-python.i:352: Error: Unable to find
'openbabel/graphsym.h'
openbabel/openbabel-python.i:353: Error: Unable to find
'openbabel/isomorphism.h'
openbabel/openbabel-python.i:354: Error: Unable to find
'openbabel/query.h'
openbabel/openbabel-python.i:355: Error: Unable to find
'openbabel/canon.h'
openbabel/openbabel-python.i:357: Error: Unable to find
'openbabel/stereo/stereo.h'
openbabel/openbabel-python.i:361: Error: Unable to find
'openbabel/rotor.h'
openbabel/openbabel-python.i:363: Error: Unable to find
'openbabel/rotamer.h'
openbabel/openbabel-python.i:364: Error: Unable to find
'openbabel/spectrophore.h'
openbabel/openbabel-python.i:435: Error: Unable to find
'openbabel/obiter.h'
openbabel/stereo.i:1: Error: Unable to find
'openbabel/stereo/tetranonplanar.h'
openbabel/stereo.i:2: Error: Unable to find
'openbabel/stereo/tetraplanar.h'
openbabel/stereo.i:3: Error: Unable to find
'openbabel/stereo/tetrahedral.h'
openbabel/stereo.i:4: Error: Unable to find
'openbabel/stereo/cistrans.h'
openbabel/stereo.i:5: Error: Unable to find
'openbabel/stereo/squareplanar.h'
openbabel/stereo.i:6: Error: Unable to find
'openbabel/stereo/bindings.h'
Error: SWIG failed. Is Open Babel installed?
You may need to manually specify the location of Open Babel include
and library directories. For example:
python setup.py build_ext -I/usr/local/include/openbabel3
-L/usr/local/lib
python setup.py install
[end of output]
note: This error originates from a subprocess, and is likely not a
problem with pip.
ERROR: Failed building wheel for openbabel
Any idea what's wrong?
Tim
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss