ANTsPy icon indicating copy to clipboard operation
ANTsPy copied to clipboard

Antspy error in kaggle notebook

Open rafaloz opened this issue 5 years ago • 9 comments

Describe the bug I am getting the next message when working with antspy in Kaggle from the wheel. I tested the versions 0.2, 0.2.7 and 0.2.9:

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

To Reproduce Steps to reproduce the behavior:

  1. Create kaggle notebook
  2. install and import antspy
  3. See error

Expected behavior Being able to work with the library seamesly

Desktop (please complete the following information): Dont know if it matters is a kaggle notebook with this https://github.com/Kaggle/docker-python/blob/main/Dockerfile dockerfile

Could you tell me against which numpy version did you build the wheels? i have tested serveral numpy versions against the ants 0.2.9 but I seem not to get the correct one. numpy from 1.21.1 to 1.9.5.

rafaloz avatar Jul 22 '21 09:07 rafaloz

what does "testing a numpy version against" ants mean? how do you get this error?

I've never seen anything like this and suspect it's something on your docker file's end or with pip's new style of conflict resolution.

we don't compile against numpy.

try googling the error and you may get some insights. e.g. https://github.com/freqtrade/freqtrade/issues/4281

stnava avatar Jul 22 '21 09:07 stnava

Thank you for your fast answer. I was testing different numpy versions with the antspy 0.2.9 in my notebook, but the error persisted, that's what I mean with "testing a numpy version against".

rafaloz avatar Jul 22 '21 10:07 rafaloz

you have not defined how you get "the error" or how you "test against" anything.

https://stackoverflow.com/help/minimal-reproducible-example

stnava avatar Jul 22 '21 10:07 stnava

I get the error after importing the library. Here is a reproducible example. Sorry if I was not enough detailed.

https://www.kaggle.com/ranafago/notebook68e3431a3e/edit

rafaloz avatar Jul 22 '21 10:07 rafaloz

here is the solution ( thanks google )

pip install numpy --upgrade

brian

On Thu, Jul 22, 2021 at 6:59 AM rafaloz @.***> wrote:

I get the error after importing the library. Here is a reproducible example. Sorry if I was not enough detailed.

https://www.kaggle.com/ranafago/notebook68e3431a3e/edit

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsPy/issues/291#issuecomment-884824977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPE7U2DVSOIW3K2SJIJPTTY72YZANCNFSM5AZUDKOA .

stnava avatar Jul 22 '21 13:07 stnava

Sorry for the inconvenience. The problem persists still when committing the notebook, or upgrading numpy before installing ants in a "factory resseted" notebook, (a new notebook). Although ANTsPy is great I will try to use another library. Thank you for your attention.

rafaloz avatar Jul 22 '21 13:07 rafaloz

up to you - but this is not an antspy issue. and the solution is clarified in multiple places online.

what I did to resolve ( demonstrated reproducibly ):

docker run --rm -it gcr.io/kaggle-images/python /bin/bash

then within the container

pip3 install numpy --upgrade --user
pip3 install antspyx --user

then we do:

import ants

and get expected behavior:

>>> import ants
2021-07-22 13:36:12.510360: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/conda/lib
2021-07-22 13:36:12.510437: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> 

maybe you could try the same procedure.

stnava avatar Jul 22 '21 13:07 stnava

After a lot of searches, the guys from Kaggle helped me identifying the issue https://github.com/Kaggle/docker-python/issues/1053#issuecomment-885228402. Thanks again for your attention!

rafaloz avatar Jul 22 '21 21:07 rafaloz

Thanks for posting a link back to the Kaggle issue.

ntustison avatar Jul 22 '21 23:07 ntustison