acil-bwh/ChestImagingPlatform

lung_lobe_segmentation_workflow.py throws up ImportError

Closed this issue · 4 comments

Hi,
I installed CIP on a ubuntu 16.04 machine using cmake 3.7.2. The installation completed without any errors. Now I want to do lung segmentation on my data, for which I use the following script:
$python ~/ChestImagingPlatform/ChestImagingPlatform-build/CIP-build/cip_python/nipype/workflows/lung_lobe_segmentation_workflow.py --in_ct ~/1700_img.nrrd --out ~/test.nrrd

But this throws up an Import error:
File "~/ChestImagingPlatform/ChestImagingPlatform-build/CIP-build/cip_python/nipype/workflows/lung_lobe_segmentation_workflow.py", line 4, in <module>
import cip_python.nipype.interfaces.cip as cip
ImportError: No module named cip_python.nipype.interfaces.cip

I see the __init__.py file in the cip_python, nipype and the interfaces folders and hence am confused about the reason for this error. Did anyone else encounter this issue?

PS: the CIP-build/bin folder is in my system path.

Hi Avnish,

I Getting below while installing in Ubunutu Ubuntu 18.04.4 LTS and cmake 10.2 . Would you please help me and give your comments.

/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 34%] Performing installpynrrd step for 'CIPPython'
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 35%] Performing installpydicom step for 'CIPPython'
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 36%] Completed 'CIPPython'
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /opt/nfsopt/anaconda3/anaconda3-2019.10/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 36%] Built target CIPPython
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

Also getting below error:
-- Configuring incomplete, errors occurred!
See also "/localscratch/Users/skuanar/tf/ChestImagingPlatform-build/OpenCV-build/CMakeFiles/CMakeOutput.log".
See also "/localscratch/Users/skuanar/tf/ChestImagingPlatform-build/OpenCV-build/CMakeFiles/CMakeError.log".
CMakeFiles/OpenCV.dir/build.make:105: recipe for target 'OpenCV-prefix/src/OpenCV-stamp/OpenCV-configure' failed
make[2]: *** [OpenCV-prefix/src/OpenCV-stamp/OpenCV-configure] Error 1
CMakeFiles/Makefile2:110: recipe for target 'CMakeFiles/OpenCV.dir/all' failed
make[1]: *** [CMakeFiles/OpenCV.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
done

Hi Shiba,

A quick comment: this error seems to be unrelated to CIP, but instead because of broken linking between the CMake and CURL library. You might wanna google for that. For example: https://stackoverflow.com/a/38896967

Best,
Avnish