UCL / STIR-exercises

Exercises for STIR
Apache License 2.0
16 stars 12 forks source link

A problem when running run_reconstruction_brain.sh #14

Closed F1HBME closed 5 years ago

F1HBME commented 5 years ago

When I ran run_reconstruction_brain.sh, an error happened: ImportError: No module named stir What should I do?

KrisThielemans commented 5 years ago

This seems a Python error, so I guess it's in the notebook, not really the shell script. If so, it means your PYTHONPATH is incorrect. It should contain wherever you installed the STIR Python interface.

can you give a bit more detail about your set-up?

F1HBME commented 5 years ago

@KrisThielemans Here is the detail about my set-up: BUILD_DOCUMENTATION OFF BUILD_EXECUTABLES ON BUILD_SHARED_LIBS OFF BUILD_SWIG_MATLAB OFF BUILD_SWIG_PYTHON ON BUILD_TESTING ON CCACHE_PROGRAM CCACHE_PROGRAM-NOTFOUND CERN_ROOT_CONFIG CERN_ROOT_CONFIG-NOTFOUND CMAKE_BUILD_TYPE Release CMAKE_INSTALL_PREFIX /usr/local CURSES_FORM_LIBRARY /usr/lib/x86_64-linux-gnu/libform.so DISABLE_AVW OFF DISABLE_CERN_ROOT OFF DISABLE_ITK OFF DISABLE_LLN_MATRIX OFF DISABLE_RDF OFF DISABLE_STIR_LOCAL OFF GRAPHICS X ITK_DIR ITK_DIR-NOTFOUND LLN_INCLUDE_DIRS LLN_INCLUDE_DIRS-NOTFOUND LLN_LIBRARIES LLN_LIBRARIES-NOTFOUND In fact, I do not really know if I installed the STIR Python interface successfully. I only know that I should set BUILD_SWIG_PYTHON on, maybe it is not enough?

KrisThielemans commented 5 years ago

I'm guessing you should have a PYTHON_DEST variable (which will likely be set to /usr/local/python from your CMAKE_INSTALL_PREFIX). In that case, you need to do something like this (assuming that you're running bash or so)

export PYTHONPATH=/usr/local/python

BEFORE starting jupyter (from the same shell).

you might want to add the above to your ~/.bashrc or similar.

F1HBME commented 5 years ago

@KrisThielemans The problem has been solved. Thank you very much.