nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
144 stars 54 forks source link

Installation issues #83

Closed jnecus closed 7 years ago

jnecus commented 7 years ago

I am attempting to setup mindboggle on Ubuntu 14.04.

I have tried both installation methods (install_script.sh and 'docker'). Here is why neither seems to be working:

install_script.sh:

Installation seems to have processed fine, however when I attempt to run 'mindboggle -h' from a terminal I get the error 'cannot import nipype, module not recognised'.

I have installed nipype and neccessary packages using anaconda python 3.5. I also get no errors when importing nipype or mindboggle from an ipython terminal.

which mindboggle /usr/local/bin/mindboggle

which 'head mindboggle' blank

Docker

Again, installation seems to have occurred fine. I am now at the stage where I can run the mindboggle command after entering the following command in a terminal:

docker run -ti -v /home/joe/Desktop/data/ADNI/subject1 --entrypoint /bin/bash bids/mindboggle This takes me to a 'root' account where I can see two folders 'data/' and 'mindboggle/', both empty. The issue is how can I make my data accessible once in Docker. The only way to once again see my files is to exit out of Docker.

satra commented 7 years ago

@jnecus: this command should be with back quotes:

which `head mindboggle`

regarding docker the -v flag takes a mapping of an external directory to an internal directory,

so you may want to do something like:

-v /home/joe/Desktop/data/ADNI/:/ADNI this will make the data available inside the container at that location.

jnecus commented 7 years ago

Hi Satra,

Thank you for for help, really looking forward to getting this working. I have attached a shot of my terminal output following your instructions.

image

binarybottle commented 7 years ago

@jnecus -- In the installation instructions (http://mindboggle.readthedocs.io/en/latest/), I specify a mount directory in Docker as follows:

PATH_ON_HOST=/; docker run --rm -ti -v $PATH_ON_HOST:/root/data \ --entrypoint /bin/bash bids/mindboggle;

Please try to set yours to /root/data as well to access your ADNI data.

@satra -- any idea why @jnecus cannot import nipype when doing a non-docker install?

jnecus commented 7 years ago

Regarding Docker install

The following command (and all manipulations of it appear to lead me to the same position whereby I see the empty folders data/ and mindboggle/ as per the screenshot.

docker run --rm -ti -v /home/joe/Desktop/data/ADNI/:/root/data --entrypoint /bin/bash bids/mindboggle

Regarding the non-docker install: When I change the shebang line at the top of the usr/local/bin/mindboggle script

from #!/usr/bin/python to #!/home/joe/anaconda3/bin/python

then the command mindboggle successfully imports nipype but instead gives the following error:

from mindboggle.features.folds import find_depth_threshold ImportError: No module named 'mindboggle'

binarybottle commented 7 years ago

Re: Docker install

I am having success after first removing all docker containers and images (https://techoverflow.net/blog/2013/10/22/docker-remove-all-images-and-containers/), then following the build instructions above. Perhaps if you try mounting the root directory (PATH_ON_HOST=/) as in the example you will be able to see your file tree?

Re: non-Docker install

If a different shebang line results in nipype vs. mindboggle importing correctly, this sounds to me like pip install (nipype) and python setup.py install (mindboggle) are calling different python distributions.

jnecus commented 7 years ago

Docker install

I successfully removed all docker containers and images as you suggested the entered the following command: PATH_ON_HOST=/; docker run --rm -ti -v $PATH_ON_HOST:/root/data --entrypoint /bin/bash bids/mindboggle;

Whatever I do I seem to reach the same position whereby I can only see empty data/ and mindboggle/ folders and cannot access my local filesystem.

Non-docker install If this is the case, would you recommend changing the shebang line within the mindboggle/ or setup.py files?

This information may help. Here is the output I get when running the install_mindboggle.sh script:

install_mindboggle.sh: 176: install_mindboggle.sh: pip: not found install_mindboggle.sh: 182: install_mindboggle.sh: conda: not found install_mindboggle.sh: 187: install_mindboggle.sh: conda: not found fatal: destination path '/home/vagrant/install/mindboggle' already exists and is not an empty directory. running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /usr/local/bin/mindboggle to 755 running install_egg_info Removing /usr/local/lib/python2.7/dist-packages/Mindboggle-1.0.0.egg-info Writing /usr/local/lib/python2.7/dist-packages/Mindboggle-1.0.0.egg-info mkdir: cannot create directory ‘/home/vagrant/install/mindboggle/vtk_cpp_tools/bin’: File exists install_mindboggle.sh: 195: install_mindboggle.sh: cmake: not found make: No targets specified and no makefile found. Stop. install_mindboggle.sh: 202: install_mindboggle.sh: source: not found fatal: destination path '/home/vagrant/downloads/ants' already exists and is not an empty directory. HEAD is now at 465cc8c... BUG: erroneous quotations in package version mkdir: cannot create directory ‘/home/vagrant/install/ants’: File exists install_mindboggle.sh: 218: install_mindboggle.sh: cmake: not found make: No targets specified and no makefile found. Stop. cp: target ‘/home/vagrant/install/ants/bin’ is not a directory install_mindboggle.sh: 226: install_mindboggle.sh: source: not found mv: cannot stat ‘/home/vagrant/install/ants/bin’: No such file or directory mv: cannot stat ‘/home/vagrant/install/ants_bin’: No such file or directory

And then when I try to run mindboggle:

Traceback (most recent call last): File "/usr/local/bin/mindboggle", line 44, in from nipype import config, logging ImportError: No module named nipype

Thanks again for your persistence!

binarybottle commented 7 years ago

Re: docker installation To make sure that you are using Docker correctly, and to determine whether the problem has anything to do with Mindboggle, please try to mount a directory according to the instructions on this site: https://linuxconfig.org/how-to-share-data-between-a-docker-container-and-host-system-using-volumes

Re: non-docker installation I have run into this problem before, where there is confusion about which is the default Python distribution. You shouldn't have to alter the code to fix this. If when you type "which python"? It gives you a Python distribution that is not Anaconda's, then you can add a line like the following to the bottom of your .bash_profile script, replacing ${Path_to_anaconda} with the path to your anaconda installation: export PATH="${Path_to_anaconda}/bin:$PATH"

Then source the script on the command line: $ source .bash_profile

And confirm that Anaconda's Python is the default distribution by again typing "which python".

I would make sure that your Python environment is set up correctly as above, remove the current Mindboggle installation, and try to re-run the install_mindboggle.sh script.

I am still testing the shell script installation on different systems, but am concentrating on containerization to make installation easier and results more consistent across platforms...

jnecus commented 7 years ago

Docker install

I managed to successfully create and mount a directory to docker following the provided tutorial

Non-docker

My default python distribution is the following

which python

/home/joe/anaconda3/bin/python

For example, this is what happens if I type into the terminal the following:

python

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux

>>>import nipype
>>>import mindboggle
>>>ImportError: no module named mindboggle

Do you have a suggested way of completely removing my manual mindboggle install?

binarybottle commented 7 years ago

I am happy to hear that you are able to mount a directory to docker now. What was the problem?

You should be able to completely remove your mindboggle installation by removing the install/mindboggle directory that the install_mindboggle.sh script creates. If you installed mindboggle using "python setup.py install" inside the mindboggle repository, then you can list and remove all files as per the following: http://askubuntu.com/questions/38692/how-does-one-remove-applications-installed-through-python-setup-py-install

binarybottle commented 7 years ago

I have also updated the install_mindboggle.sh script so that it doesn't assume a Vagrant installation by default: https://github.com/nipy/mindboggle/blob/master/install_mindboggle.sh

jnecus commented 7 years ago

Docker install

Sorry if I wasn't clear in my last post. What I meant was that I was successfully able to remove all docker containers and images, and also successfully able to create a file and then mount it via the tutorial which you posted. However, when I attempt to mount to docker using the following code docker run --rm -ti -v path/to/my/files:/root/data --entrypoint /bin/bash bids/mindboggle; then I cannot see any of my file structure.

Non-docker install

I uninstalled and re-installed using the new mindboggle_install.sh script and I can now successfully run the command mindboggle, yippee!

However, after trying to run on two separate test subjects I receive the following errors:

161202-10:02:41,329 workflow ERROR: could not run node: Mindboggle.Fetch_Mindboggle_atlas 161202-10:02:41,329 workflow ERROR: could not run node: Mindboggle.MRI_mgh_format

akeshavan commented 7 years ago

able to create a file and then mount it via the tutorial which you posted. However, when I attempt to mount to docker using the following code docker run --rm -ti -v path/to/my/files:/root/data --entrypoint /bin/bash bids/mindboggle; then I cannot see any of my file structure.

Is your issue similar to this: https://github.com/docker/docker/issues/22981 ?

However, after trying to run on two separate test subjects I receive the following errors:

What does the error say? Usually, a crash file is created and you can view it using nipype_display_crash /path/to/crashfile

jnecus commented 7 years ago

The docker issue is similar, however, I am using a linux machine with Ubuntu 14.04, not Windows 10.

nipype_display_crash doesnt seem to work for me. Errors are as posted above: could not run node: Mindboggle.Fetch_Mindboggle_atlas & could not run node: Mindboggle.MRI_mgh_format

satra commented 7 years ago

@jnecus - could you try mounting the external drive at a different location (e.g., /xyz) and then check.

docker run --rm -ti -v path/to/my/files:/xyz bash
# ls /xyz

regarding nipype_display_crash can you instead check if you have nipypecli using which nipypecli. if so the new command is call nipypecli crash.

jnecus commented 7 years ago

When I enter the code that you suggested:

docker run --rm -ti -v path/to/my/files:/xyz bash
# ls /xyz

I am able to see my file structure under the folder /xyz

I have attached the mindboggle crash file output:

crash1.txt

akeshavan commented 7 years ago

I remember this bug, I thought I fixed it! It looks good here: https://github.com/binarybottle/mindboggle/blob/master/mindboggle/mindboggle#L452 but not good here: https://github.com/nipy/mindboggle/blob/master/mindboggle/mindboggle#L452

@binarybottle it seems like the nipy/mindboggle and binarybottle/mindboggle aren't in sync?

binarybottle commented 7 years ago

Non-docker install:

@akeshavan -- This is very odd -- you did make this fix back in May (https://github.com/nipy/mindboggle/commit/0d6804c98a01f1b9f6453f72909b96ed63302e64). I just updated the nipy mindboggle repo accordingly.

jnecus commented 7 years ago

@binarybottle After removing and re-installing Docker, I am now able to successfully mount to docker, see my files, and run mindboggle.

The issue that I now face is that if I exit docker while running mindboggle then the processes fail. This is still the case when I use the command nohup & . Do you know of a way to ensure that background processes continue to run?

binarybottle commented 7 years ago

@jnecus -- The docker and non-docker installs were cloning two different mindboggle repositories, but @akeshavan fixed this so that they now both clone the nipy/mindboggle repository. I just tested out the docker and non-docker (in a Virtualbox Ubuntu 14.04 virtual machine) installations on my MacOS laptop, and Mindboggle ran to completion for both setups. Could you please give it another try?

jnecus commented 7 years ago

I am now running in Docker. I have used to command ctrl-p, ctrl-q to cause the Docker to continue to run in the background (assuming this will work with mindboggle?).

If it runs through to completion I will try the non-docker install and let you know and hopefully this issue can then be closed.

binarybottle commented 7 years ago

Thank you! Please tell me how it goes.

jnecus commented 7 years ago

Update:

Docker:

Docker failed with crash relating to mgh format: MRI_mgh_format_crash.txt .

I think that this is due to my freesurfer output missing an mri/orig/001.mgz file - would you expect this to be the case? I am now re-running with a freesurfer subject which contains this file.

Non-Docker:

Failure with the following crash file:

crash.txt

binarybottle commented 7 years ago

Docker

I'm not sure why you got the error in your crash file ("The trait 'base_directory' of a DataGrabberInputSpec instance is an existing directory name, but the path '/root/data/Mindboggle_test241116/ADNI' does not exist." @satra -- any idea?), but Mindboggle does use the 001.mgz and orig.mgz files. Why is your FreeSurfer output missing these files? Didn't you run recon-all?

Non-Docker

I fixed this bug two days ago (see "I just updated the nipy mindboggle repo accordingly." above), so please completely uninstall Mindboggle (as above), remove the installation directory and Mindboggle outputs, re-run the install_mindboggle.sh script, and try again.

jnecus commented 7 years ago

Update:

Both docker and non-docker installs have run to completion without generating crash files :+1:

Thanks for your support. Now to take a look at the outputs..

binarybottle commented 7 years ago

Great! So happy to hear. Thank you for your help and for your patience. I will close this issue, but I encourage you to open new issues for any new problems you run into!