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

pip install & ImportError #53

Closed
Borda opened this issue Mar 25, 2019 · 5 comments
Closed

pip install & ImportError #53

Borda opened this issue Mar 25, 2019 · 5 comments

Comments

@Borda
Copy link
Contributor

Borda commented Mar 25, 2019

Describe the bug
I am facing some difficulty with compiling the

To Reproduce
Steps to reproduce the behavior:

  1. pip install cmake
  2. pip install git+https://github.com/ANTsX/ANTsPy.git
  3. run https://github.com/Borda/BIRL/blob/master/scripts/Python/run_ANTsPy.py
    python3 BIRL/results/BmANTsPy/run_ANTsPy.py BIRL/data_images/rat-kidney_/scale-5pc/Rat_Kidney_HE.jpg BIRL/data_images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.jpg BIRL/data_images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.csv BIRL/results/BmANTsPy/0
  4. See error
Traceback (most recent call last):
  File "/home.dokt/borovji3/Medical-temp/experiments_anhir/BmANTsPy_20190325-153014/run_ANTsPy.py", line 18, in <module>
    import ants
  File "~/vEnv3/lib/python3.5/site-packages/ants/__init__.py", line 7, in <module>
    from .core import *
  File "~/vEnv3/lib/python3.5/site-packages/ants/core/__init__.py", line 2, in <module>
    from .ants_image import *
  File "~/vEnv3/lib/python3.5/site-packages/ants/core/ants_image.py", line 27, in <module>
    from .. import utils, registration, segmentation, viz
  File "~/vEnv3/lib/python3.5/site-packages/ants/utils/__init__.py", line 2, in <module>
    from .bias_correction import *
  File "~/vEnv3/lib/python3.5/site-packages/ants/utils/bias_correction.py", line 9, in <module>
    from . import process_args as pargs
  File "~/vEnv3/lib/python3.5/site-packages/ants/utils/process_args.py", line 13, in <module>
    from .. import lib
  File "~/vEnv3/lib/python3.5/site-packages/ants/lib/__init__.py", line 35, in <module>
    from .antsRegistration import *
ImportError: ~/vEnv3/lib/python3.5/site-packages/ants/lib/antsRegistration.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _Z14ANTSFileExistsRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Desktop (please complete the following information):

  • (sysname='Linux', nodename='cmpgrid-73', release='4.9.0-6-amd64', version='#1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02)', machine='x86_64')
  • Python 3.5.3 (default, Jan 19 2017, 14:11:04) ; [GCC 6.3.0 20170118] on linux
@stnava
Copy link
Member

stnava commented Mar 26, 2019

did you try the more standard approach of

  • git clone https://github.com/ANTsX/ANTsPy.git
  • cd ANTsPy
  • python3 setup.py install

@Borda
Copy link
Contributor Author

Borda commented Mar 26, 2019

It does not help for installing on that particular server machine... I was instaling it on ma personal machine, and it works there... so it probably linked to the specific configuration, could it be?

@Borda Borda mentioned this issue Mar 26, 2019
2 tasks
@stnava
Copy link
Member

stnava commented Jun 28, 2019

Unclear if this can/will be addressed. Please reopen if needed.

@stnava stnava closed this as completed Jun 28, 2019
@muschellij2
Copy link
Contributor

muschellij2 commented Jan 28, 2020

Got the same issue/error. https://travis-ci.com/muschellij2/deepbleed/jobs/281243452#L7693. I think this may be due to the fact I forgot the ITKR (which builds a lib for ITK) was built on trusty. Trying on trusty now. Edit - that was not true - they were built on xenial and so was the build I refernced above.

@wmdatah
Copy link

wmdatah commented Jun 6, 2023

The following attempts were made on a POWER 9, with nvidia tesla, running Ubuntu 22.04:

straight to bare metal

  • conda env (py3.9) + pip install antspyx (0.3.7 and 0.3.8)
  • git clone (a few different tags were tried) + python setup.py install

docker containers

  • nvidia/cuda:12.1.1-cudnn8-devel-ubi8
  • quay.io/rocketce/tensorflow:py39-rce180 (ubi8)
    on both: conda... + pip install... or git clone/setup.py

This is just a summary, I've been trying for a few days now, but today I gave up after trying with docker build and getting the exact same error as every other attempt:

ImportError: /opt/conda/lib/python3.10/site-packages/ants/lib/antsRegistration.cpython-310-powerpc64le-linux-gnu.so: undefined symbol: _Z14ANTSFileExistsRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

In one of the attempts, in a container, I launched a
scanelf -s _Z14ANTSFileExistsRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE -R / 2>/dev/null | grep _Z14ANT...
and I noticed that only other files in the same directory as antsRegistration.cpython-310-powerpc64le-linux-gnu.so have such a symbol. I haven't looked for such a symbol using other tools for other file types.

Could someone give me a hug to lessen my frustration? 😅 Or else shed some light on my ignorance? Any tip is worth. Thanks in advance.

Here is part of the docker build output:

Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-73-generic ppc64le)
...
  System information as of Tue Jun  6 04:06:40 PM -03 2023
...
git clone https://github.com/ANTsX/ANTsPy.git
cd ANTsPy
docker build -t antspy:master .
...
 => [internal] load build definition from Dockerfile
...
 => [stage-1 1/2] FROM docker.io/library/debian:bullseye-20230109-slim@sha256:98d3b4b0cee264301eb1354e0b549323af2d0633e1c43375d0b25c01826b6790
...
 => [builder 1/9] FROM docker.io/continuumio/miniconda3:22.11.1@sha256:10b38c9a8a51692838ce4517e8c74515499b68d58c8a2000d8a9df7f0f08fc5e
...
 => [internal] load build context
 => => transferring context: 105.30MB
 => [builder 2/9] RUN apt-get update && apt-get install -y --no-install-recommends apt-transport-https bash build-essential git libpng-dev
 => [builder 3/9] RUN conda install -c anaconda cmake
 => [builder 4/9] WORKDIR /usr/local/src
 => [builder 5/9] COPY environment.yml .
 => [builder 6/9] RUN conda env update -n base
 => [builder 7/9] COPY . .
 => [builder 8/9] RUN pip --no-cache-dir -v install .
 => ERROR [builder 9/9] RUN bash tests/run_tests.sh
------
 > [builder 9/9] RUN bash tests/run_tests.sh:
#0 0.415 /usr/local/src/tests /usr/local/src
#0 0.415 Running core tests
#0 1.720 Traceback (most recent call last):
#0 1.720   File "/usr/local/src/tests/test_core_ants_image.py", line 19, in <module>
#0 1.720     import ants
#0 1.720   File "/opt/conda/lib/python3.10/site-packages/ants/__init__.py", line 7, in <module>
#0 1.720     from .core import *
#0 1.720   File "/opt/conda/lib/python3.10/site-packages/ants/core/__init__.py", line 2, in <module>
#0 1.720     from .ants_image import *
#0 1.720   File "/opt/conda/lib/python3.10/site-packages/ants/core/ants_image.py", line 29, in <module>
#0 1.720     from .. import registration, segmentation, utils, viz
#0 1.720   File "/opt/conda/lib/python3.10/site-packages/ants/registration/__init__.py", line 3, in <module>
#0 1.720     from .affine_initializer import *
#0 1.720   File "/opt/conda/lib/python3.10/site-packages/ants/registration/affine_initializer.py", line 7, in <module>
#0 1.721     from .. import utils
#0 1.721   File "/opt/conda/lib/python3.10/site-packages/ants/utils/__init__.py", line 2, in <module>
#0 1.721     from .bias_correction import *
#0 1.721   File "/opt/conda/lib/python3.10/site-packages/ants/utils/bias_correction.py", line 4, in <module>
#0 1.721     from . import process_args as pargs
#0 1.721   File "/opt/conda/lib/python3.10/site-packages/ants/utils/process_args.py", line 14, in <module>
#0 1.721     from .. import lib
#0 1.721   File "/opt/conda/lib/python3.10/site-packages/ants/lib/__init__.py", line 44, in <module>
#0 1.721     from .antsRegistration import *
#0 1.721 ImportError: /opt/conda/lib/python3.10/site-packages/ants/lib/antsRegistration.cpython-310-powerpc64le-linux-gnu.so: undefined symbol: _Z14ANTSFileExistsRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
------
Dockerfile:31
--------------------
  29 |     
  30 |     # run tests
  31 | >>> RUN bash tests/run_tests.sh
  32 |     
  33 |     # optimize layers
--------------------
ERROR: failed to solve: process "/bin/sh -c bash tests/run_tests.sh" did not complete successfully: exit code: 1

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