openbabel / conda-openbabel Goto Github PK
View Code? Open in Web Editor NEWConda build recipe for Open Babel
Conda build recipe for Open Babel
In ubuntu apt-get there exists the deb package libopenbabel-dev containing the development files of openbabel.
Is there an equivalent when installing openbabel through conda, such that it is possible to use link to openbabel in a c++ projects?
Hi,
I have anaconda installed and set up an environment with openbabel. It runs great when running from anaconda however i need to run through other software where i have to set the python interpreter "C:\ProgramData\Anaconda3\envs\python3-10-9\python.exe" and that's where the problems begin. How do i get it to open the environment as a conda environment or what do i have to set in my script to get it to work?
I need it for Spotfire data functions
from the python exe
Python 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openbabel import pybel
>>> print(pybel.readstring("smi", "CN2C(=O)N(C)C(=O)C1=C2N=CN1C").write("can"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\python3-10-9\lib\openbabel\pybel.py", line 200, in readstring
raise ValueError("%s is not a recognised Open Babel format" % format)
ValueError: smi is not a recognised Open Babel format
How do i start python like this? keeping in mind i have to be able to set the path like this "C:\ProgramData\Anaconda3\envs\python3-10-9\python.exe"
what does anaconda run when we click "Run with Python"?
C:\Users\Administrator>conda.bat activate "C:\ProgramData\Anaconda3\envs\python3-10-9"
C:\Users\Administrator>set OLD_BABEL_DATADIR=C:\ProgramData\Anaconda3\envs\python3-10-9\share\openbabel
C:\Users\Administrator>set BABEL_DATADIR=C:\ProgramData\Anaconda3\envs\python3-10-9\share\openbabel
Python 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openbabel import pybel
>>> print(pybel.readstring("smi", "CN2C(=O)N(C)C(=O)C1=C2N=CN1C").write("can"))
Cn1cnc2c1c(=O)n(C)c(=O)n2C
>>>
I tried the following on Ubuntu 18.04 and centos 7 - both under Docker and on a regular virtual machine. Both with Miniconda 3 latest and Anaconda 3 latest, and always received the same results:
conda create --name env
conda install -c openbabel openbabel
All is well. Then I try obabel -i <pdb filename>
or even just babel
and get a long list of
*** Open Babel Error in openLib
/root/anaconda3/envs/env/lib/openbabel/2.4.1/fastsearchformat.so did not load properly.
Error: libXrender.so.1: cannot open shared object file: No such file or directory
.
. I get this once for every *format.so in the Open Babel directory
.
Segmentation fault
When using the Python API to read a file, I get the same errors written to the terminal, and open babel fails to open the file because it doesn't know how to handle PDB files.
hi,
while I tried to install openbabel-3.1.1-source.tar.bz2 downloaded from github reopo, the local installation via conda failed.
my command used for installing package.
conda install --use-local openbabel-3.1.1-source.tar.bz2
the error reported as below
Downloading and Extracting Packages
| 0% ERROR: Encountered corrupt package tarball at C:\Users\..\.conda\pkgs\openbabel-3.1.1-source.tar.bz2. Conda has left it in place. Please report this to the maintainers of the package.
could you please help to explain the issues and how can I install the openbabel locally from the package? many thanks,
Shengyang
I tried installing OpenBabel via conda install -c conda-forge openbabel
, and it seemed to succeed. I'm able to find the obabel
binary and all of the tests in meta.yaml
run just fine. However, when I try to run import pybel
in python (either a Jupyter notebook or the REPL), I get
ModuleNotFoundError: No module named 'pybel'
It looks like the python bindings aren't built or just not linked to the local library. Is there a quick fix I can do for this?
hi Sorry to bother you. I suppose the developer version is the 2.5.x Does anyone can tell me how can i compile it with anaconda? i tried cloning this, but it returns me 2.4.1
Can @mwojcikowski, @mcs07 and @njzjz tell me what instructions I should add to the website and docs for users to tell them how to install Open Babel 3.0 using conda?
Think here of the naive user. We need one official way, which one/all of you will be able to help fix if there is a problem. We can add more details about different approaches using different channels but we need to agree on an 'official' approach.
hi,
Do you mind if I submit this recipe to conda-forge? This will greatly help dependencies of other software.
I recently ran into an issue where we thought that having packages that depend on libgcc and libgcc-ng caused problems (see conda issue here). We were told to rebuild all of our dependencies that required libgcc in favor of libgcc-ng, which included openbabel. I took a look at your conda recipe for 2.4.1 (python 2.7 version shown, but python 3.7 version has the same features) and found something interesting: openbabel requires libgcc-ng to build, but libgcc instead is listed as a requirement to run.
# This file created by conda-build 3.17.7
# meta.yaml template originally from:
# /recipe, last modified Sat Jan 19 10:20:14 2019
# ------------------------------------------------
package:
name: openbabel
version: 2.4.1
source:
fn: openbabel-2-4-1.zip
patches:
- fix_babel_test_paths.diff
- fix_data_path.diff
- fix_library_path_search.diff
- python_link.diff
sha1: 6fefb2355601b665bea5840fe8e6f95bd48023c9
url: https://github.com/openbabel/openbabel/archive/openbabel-2-4-1.zip
build:
detect_binary_files_with_prefix: true
number: '5'
string: py27_5
requirements:
build:
- bzip2 1.0.6 h14c3975_5
- ca-certificates 2018.03.07 0
- cairo 1.14.12 h8948797_3
- certifi 2018.11.29 py27_0
- cmake 3.12.2 h52cb24c_0
- eigen 3.2.8 2
- expat 2.2.6 he6710b0_0
- fontconfig 2.13.0 h9420a91_0
- freetype 2.9.1 h8a8886c_1
- glib 2.56.2 hd408876_0
- icu 58.2 h9c2bf20_1
- krb5 1.16.1 h173b8e3_7
- libcurl 7.63.0 h20c2e04_1000
- libedit 3.1.20170329 h6b74fdf_2
- libffi 3.2.1 hd88cf55_4
- libgcc-ng 8.2.0 hdf63c60_1
- libpng 1.6.36 hbc83047_0
- libssh2 1.8.0 h1ba5d50_4
- libstdcxx-ng 8.2.0 hdf63c60_1
- libuuid 1.0.3 h1bed415_2
- libxcb 1.13 h1bed415_1
- libxml2 2.9.8 h26e45fe_1
- ncurses 6.1 he6710b0_1
- openssl 1.1.1a h7b6447c_0
- pcre 8.42 h439df22_0
- pip 18.1 py27_0
- pixman 0.36.0 h7b6447c_0
- python 2.7.15 h9bab390_6
- readline 7.0 h7b6447c_5
- rhash 1.3.7 h1ba5d50_0
- setuptools 40.6.3 py27_0
- sqlite 3.26.0 h7b6447c_0
- swig 3.0.12 h38cdd7d_3
- tk 8.6.8 hbc83047_0
- wheel 0.32.3 py27_0
- xz 5.2.4 h14c3975_4
- zlib 1.2.11 h7b6447c_3
run:
- bzip2 >=1.0.6,<2.0a0
- cairo >=1.14.12,<2.0a0
- libgcc
- libxml2 >=2.9.8,<2.10.0a0
- python >=2.7,<2.8.0a0
- zlib >=1.2.11,<1.3.0a0
test:
commands:
- obabel --help
- obabel -:c1ccccc1 --gen3d -omol2
- obabel -:c1ccccc1 --gen3d -oinchi
- obabel -:c1ccccc1 -opng -O img.png
imports:
- openbabel
- pybel
about:
home: http://www.openbabel.org/
license: GPLv2
summary: A chemical toolbox designed to speak the many languages of chemical data
extra:
copy_test_source_files: true
final: true
Is there a reason why openbabel needs libgcc to run as opposed to libgcc-ng even though it is built with libgcc-ng? If not this is probably not something worth immediately rebuilding your packages for (our issue ended up not being directly related to this anyways), but it might be worth updating the recipe so that future builds only depend on libgcc-ng. I am not a conda expert at all but based on the feedback we got from conda it appears that they want to move away from libgcc in favor of libgcc-ng.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.