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: module compiled against API version 0xe but this version of numpy is 0xd #338

Closed
erkutaykutlug opened this issue May 24, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@erkutaykutlug
Copy link

erkutaykutlug commented May 24, 2021

Describe the bug
New installation using conda env file envs/environment-py38.yml is giving the following error. Probably from similar causes in the open issue 305

The error goes away when numpy is upgraded to 1.20, but that raises incompatibility warning with tensorflow 2.3.2.

To Reproduce
After clean install run examples/uplift_tree_visualization.ipynb

Screenshots

from causalml.dataset import synthetic_data

 1 from .models import UpliftTreeClassifier, DecisionTree
      2 from .models import UpliftRandomForestClassifier
----> 3 from  .causaltree import CausalMSE, CausalTreeRegressor
      4 from .plot import uplift_tree_string, uplift_tree_plot
      5 from .utils import cat_group, cat_transform, cv_fold_index, cat_continuous, kpi_transform

__init__.pxd in init causalml.inference.tree.causaltree()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

Environment:

  • OS: Ubuntu 18.04
  • Python Version: 3.8
  • Versions of Major Dependencies
    clean conda env install using envs/environment-py38.yml

The error

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
@erkutaykutlug erkutaykutlug added the bug Something isn't working label May 24, 2021
@jeongyoonlee
Copy link
Collaborator

Thanks @erkutaykutlug for reporting this. As described in #343, this is due to incompatibility between tensorflow and numpy>=1.20. #343 addressed it by making tensorflow optional for installation, and moved tensorflow out of default environments-py3x.yml.

@yiming-sun-stat
Copy link

I did not find tensorflow in requirements.txt but pip install causalml still automatically install tensorflow why?

@ras44
Copy link
Collaborator

ras44 commented Sep 7, 2022

I get a similar error, even when creating a new conda env following the instructions in the README.md :

$ git clone https://github.com/uber/causalml.git
$ cd causalml/envs/
$ conda env create -f environment-py38.yml	# for the virtual environment with Python 3.8 and CausalML
$ conda activate causalml-py38
(causalml-py38)

When I do the above, and then open the example in jupyter lab using the causalml-py38 kernel, I get the error

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xe

Follow up:

@jeongyoonlee FYI, I don't get the above error for the environment-py37.yml env, only for the environment-py38.yml env. I am able to resolve the issue by bumping numpy==1.23.2 in the file. I will submit a PR in case it is of use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants