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

ImportError: No module named radiomics #217

Closed
devareddy opened this issue Mar 7, 2017 · 7 comments
Closed

ImportError: No module named radiomics #217

devareddy opened this issue Mar 7, 2017 · 7 comments

Comments

@devareddy
Copy link

While am trying to run example under bin directory from Jupyter & command prompt am experiencing
"ImportError: No module named radiomics".
Any help in fixing this is appreciated.

Thanks in advance
-Reddy

@JoostJM
Copy link
Collaborator

JoostJM commented Mar 7, 2017

@devareddy, did you install the package using python setup.py install?
Additionally, if you have 2 versions of python installed, you need to be careful on which version python is installed and which python version jupyter is running.

@devareddy
Copy link
Author

Thanks JoostJM.
Yes i did install using python setup.py install.
Last two lines after running above command:
"Using /usr/local/lib/python2.7/dist-packages"
"Finished processing dependencies for pyradiomics==1.1.0.post5.dev0+g79a84e9"
Am running Jupyter using Python 2.
Am i missing some thing?

@JoostJM
Copy link
Collaborator

JoostJM commented Mar 7, 2017

@devareddy, Did you start jupyter/cmd before you installed the package? If that is the case, you'll need to restart cmd/jupyter (for jupyter, also restart the cmd window), as the install updates the python easy-install path (which python uses to find the package).

If you want to manually check if pyradiomics is installed, go to your python directory, and go to the Lib/site-packages folders. There should be a pyradiomics folder in there, containing the radiomics folder and a data folder.

@devareddy
Copy link
Author

@JoostJM, Thanks for the help.Am able run the example for command line but not from jupyter .
But it is giving an error while running > python helloRadiomics.py
Error loading C extensions, switching to python calculation:
Traceback (most recent call last):
File "/home/user/radiomics/pyradiomics/radiomics/init.py", line 140, in
from radiomics import _cmatrices as cMatrices
ImportError: cannot import name _cmatrices

Can you help in fixing this issue?
Thanks in advance.
-Reddy

@JoostJM
Copy link
Collaborator

JoostJM commented Mar 7, 2017

@devareddy This means that PyRadiomics is loading, but has trouble finding the C compiled extensions.
It is a bug we come across more often, and is caused by the fact that as jupyter is running from within the bin folder with python 2.7, it finds the source code radiomics folder, and not the installed folder. For the python files, this makes no difference. However, the C extensions are only present in the installed folder when you run python setup.py install.

You can fix this bug by running python setup.py develop, which generates an in-source build (i.e. compiles the C extensions and copies them to the radiomics folder in the git repo.

@devareddy
Copy link
Author

@JoostJM, Thanks for the help.Am able run the example for command line but not from jupyter .
But it is giving an error while running > python helloRadiomics.py
Error loading C extensions, switching to python calculation:
Traceback (most recent call last):
File "/home/user/radiomics/pyradiomics/radiomics/init.py", line 140, in
from radiomics import _cmatrices as cMatrices
ImportError: cannot import name _cmatrices

Can you help in fixing this issue?
Thanks in advance.
-Reddy

@devareddy devareddy reopened this Mar 7, 2017
@devareddy
Copy link
Author

@JoostJM , Perfect and Thanks a lot.
Am able to run samples.
Thanks once again.
-Reddy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants