Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError when using numpy <1.13 #57

Open
marta-sd opened this issue Oct 30, 2017 · 6 comments
Open

RuntimeError when using numpy <1.13 #57

marta-sd opened this issue Oct 30, 2017 · 6 comments

Comments

@marta-sd
Copy link

Hi,

I have troubles working with the newest version of RDKit together with not-the-newest version of numpy.

It seems like rdkit package requires numpy=1.13, although it is not stated in the dependencies. The simplest example that doesn't work (tested on Ubuntu 16.04):

conda create -c rdkit -n rdkit_test python=3.6 numpy=1.12 rdkit=2017.09.1
source activate rdkit_test

and then in Python I get this error:

>>> import rdkit
>>> from rdkit import Chem
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/martas/miniconda3/envs/rdkit_test/lib/python3.6/site-packages/rdkit/Chem/__init__.py", line 25, in <module>
    from rdkit.Chem.rdmolops import *
SystemError: initialization of rdmolops raised unreported exception

Note that importing rdkit doesn't raise the exception. Also, when I use Python 2.7 I get slightly different error:

>>> from rdkit import Chem
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/martas/miniconda3/envs/rdkit_py27/lib/python2.7/site-packages/rdkit/Chem/__init__.py", line 25, in <module>
    from rdkit.Chem.rdmolops import *
ImportError: numpy.core.multiarray failed to import

When I create the environment with numpy v. 1.13 everything works fine (checked in Py3.6 and Py2.7).

@mwojcikowski
Copy link

It might be like glibc compatibility, so that the compiled version is the oldest supported. That way if we compile with numpy 1.13 the requirement is numpy => 1.13.

@marta-sd
Copy link
Author

marta-sd commented Nov 7, 2017

Update: @mwojcikowski compiled rdkit with numpy=1.12, and indeed it works both with 1.12 and 1.13

@greglandrum
Copy link
Member

That's strange... the version of the code that I did the conda builds from (the development branch) does actually specify a numpy version:
https://github.com/rdkit/conda-rdkit/blob/development/rdkit/meta.yaml
maybe I screwed something up when I did the builds.

I guess you're on linux?

@marta-sd
Copy link
Author

marta-sd commented Nov 8, 2017

Yes, I'm using linux.

If I understood correctly, this line:

- numpy >=1.12

should be numpy ==1.12. When its >=1.12, conda can use the most recent version (1.13) to build this package and then it doesn't support the older one (1.12).

Note, that this line:

- numpy >=1.12

should stay as it is.

@greglandrum
Copy link
Member

Got it. Thanks.
@rvianello : does this seem right to you too?

@rvianello
Copy link
Contributor

yes, I couldn't test it, but it makes sense to me. I think conda build also supported a specific syntax that was intended to define the runtime requirements based on what was used at build time, but this is also changing a bit in version 3.x, so the proposed constraints should be fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants