ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
608 stars 161 forks source link

Having trouble installing ANTS. #490

Closed YasmineMH1997 closed 1 year ago

YasmineMH1997 commented 1 year ago

I used the following to install ants but nothing seems to work.

pip install antspyx git clone https://github.com/ANTsX/ANTsPy cd ANTsPy python3 setup.py install image

When did the error occur?

[ ] CMake configuration (cmake / ccmake) [ ] Compilation (make) [ ] Installation (make install)

Build environment

ANTs version

Build configuration and logs

Additional context

cookpa commented 1 year ago

Maybe this is a Ubuntu 22 problem? Same OS as #487

On my Ubuntu 20.04 VM, it installs and works

conda create -n antspypip python=3.8
conda activate antspypip
pip install antspyx
python
>>> import ants
>>> image = ants.image_read('brainMasked.nii.gz')
>>> image
ANTsImage (LPI)
     Pixel Type : float (float32)
     Components : 1
     Dimensions : (224, 320, 320)
     Spacing    : (0.8, 0.8, 0.8)
     Origin     : (99.6298, 119.9129, -149.0895)
     Direction  : [-0.9936  0.0182 -0.1116 -0.0188 -0.9998  0.0045 -0.1115  0.0066  0.9937]
>>> 
cookpa commented 1 year ago

@YasmineMH1997 what is your python version?

YasmineMH1997 commented 1 year ago

At first, I tried 3.10. Now I am trying an environment with 3.8 python but struggling with this error: image

cookpa commented 1 year ago

OK that's a lead, libstdc++ might be incompatible with the wheels.

Can you reproduce outside of a notebook? Run a minimal example from a terminal, and paste the full error?

Thanks

YasmineMH1997 commented 1 year ago

Oh I think it worked when I ran the few lines you provided:

conda create -n antspypip python=3.8
conda activate antspypip
pip install antspyx

image image

I think it goes wrong when I add these lines: git clone https://github.com/ANTsX/ANTsPy cd ANTsPy python3 setup.py install

I am not sure.

cookpa commented 1 year ago

Great, if pip install works, there's no need to clone the source and install with setup.

YasmineMH1997 commented 1 year ago

Thank you ^__^