daducci / COMMIT

Linear framework to combine tractography and tissue micro-structure estimation with diffusion MRI
Other
43 stars 33 forks source link

Error for building an operator #30

Closed behnam12 closed 5 years ago

behnam12 commented 6 years ago

I am going to use COMMIT framework for fiber tracking, but I've faced with the following error _importError:Buildingnmodule commit.operator.operator failed:permission denied: '/_common/apps/.../operator/operatorwithLUT.c when I want to build an operator with command mit.build.operator() I am grateful for any guidance to solve it.

Thank you Behnam

barakovic commented 6 years ago

Hello Behnam, I assume that you installed COMMIT without errors and you are trying to use the initial demo that we provide. It seems that the folder where COMMIT is installed has permission issues. Can you try one of the two options: 1) give permission to that folder 'operator' 2) use "sudo ipython" instead of "ipython"

Hope this can help,

Muhamed

behnam12 commented 6 years ago

Thank you for suggestion. Now, I've faced with another error for building an operator as following: It would be very helpful if you could give me a suggestion to solve it.

Thanks a lot Behnam

>>> mit.build_operator()

-> Building linear operator A:
/home/ashtarayeh/.pyxbld/temp.linux-x86_64-2.7/pyrex/commit/operator/operator.c:8:22: fatal error: pyconfig.h: No such file or directory
 #include "pyconfig.h"
                      ^
compilation terminated.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "commit/core.pyx", line 606, in commit.core.Evaluation.build_operator (commit/core.cpp:13903)
  File "/usr/lib/python2.7/dist-packages/pyximport/pyximport.py", line 431, in load_module
    language_level=self.language_level)
  File "/usr/lib/python2.7/dist-packages/pyximport/pyximport.py", line 209, in load_module
    inplace=build_inplace, language_level=language_level)
  File "/usr/lib/python2.7/dist-packages/pyximport/pyximport.py", line 186, in build_module
    reload_support=pyxargs.reload_support)
  File "/usr/lib/python2.7/dist-packages/pyximport/pyxbuild.py", line 98, in pyx_to_dll
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 163, in run
    _build_ext.build_ext.run(self)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
    self.build_extensions()
  File "/usr/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 171, in build_extensions
    self.build_extension(ext)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 496, in build_extension
    depends=ext.depends)
  File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile
    raise CompileError, msg
ImportError: Building module commit.operator.operator failed: ["CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"]
barakovic commented 6 years ago

Looks like you don't have the Python headers on your machine. Which OS are you using? Indeed it can be that this problem is related to permission issues.

In order to have all the libraries needed to run the framework, we suggest to install Anaconda. Can you try to uninstall the actual version of COMMIT, for then install Anaconda and COMMIT? https://github.com/daducci/COMMIT/blob/master/doc/install.md

Cheers,

Muhamed