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
625 stars 161 forks source link

A installation problem on centos 7 #451

Closed TSbme closed 1 year ago

TSbme commented 1 year ago

When I use pip to install ANTs: python3 setup.py install It shows the problem: running install running build_py running build_ext Configuring ITK No local ITK installation found... Building ITK now... error: [Errno 2] No such file or directory: './scripts/configure_ITK.sh': './scripts/configure_ITK.sh'

cookpa commented 1 year ago

This might be a problem with paths in subprocess. If I open a PR to fix, can you test? I don't have a Centos machine here and I don't see the error on Mac or Ubuntu.

cookpa commented 1 year ago

Update: I tried this in a Centos 7 VM and cannot reproduce the error.

My thinking was that subprocess was failing to find the script for some reason, based on this

image

https://docs.python.org/3/library/subprocess.html#popen-constructor

So one idea would be to use absolute paths in the script.

However, when I run python3 setup.py install on Centos7, I don't get the error.

cookpa commented 1 year ago

OK, I built antspy successfully using

Centos 7 (devtoolset-8, also had to install python3-devel and libjpeg-devel) python 3.6.8

Then this works for me, inside a devtoolset-8 shell:

$ python3 -m venv /tmp/antspyenv
$ source /tmp/antspyenv/bin/activate
$ cd ANTsPy 
$ python3 setup.py install
cookpa commented 1 year ago

Using Miniconda on Centos7, I can install and run from pypi:

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

It installs antspyx-0.3.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Closing for now