Antspy error in kaggle notebook
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:
- Create kaggle notebook
- install and import antspy
- 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.
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
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".
you have not defined how you get "the error" or how you "test against" anything.
https://stackoverflow.com/help/minimal-reproducible-example
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
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 .
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.
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.
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!
Thanks for posting a link back to the Kaggle issue.