mindboggle
mindboggle copied to clipboard
Importing mindboggle
I have a super simple question. I have built a docker image for which I would like to install this library. I am able to install nipy (RUN pip install --user nipy==0.4.2), but when I import it in a docker shell, I get the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nipy'
And mindboggle itself does not appear to be able to be installed via pip. How would you recommend getting a copy of this library in a docker image? I don't want to use the existing mindboggle image as a base because I already have another image I am building off of. Hoping to hear that there is a line, or a couple of lines, I can add to my Dockerfile to install this without building off of the existing image.
"No module named 'nipy'"
I have built a docker image for which I would like to install this library. I am able to install nipy (
RUN pip install --user nipy==0.4.2), but when I import it in a docker shell, I get the following error:Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nipy'
pip is installing in a different environment than the one in which you're trying to import it.
Running
pip installwith the--userflag installs the dependencies for the current user in the.local/bindirectory in the users home directory. Therefore, we need to add this newly created directory to the PATH environment variable. ― Florian Dahlitz
Depending on the rest of your Dockerfile and how you're entering your container there are different ways of matching environments, but the basic idea is you want to get from

to
![]() | or | ![]() |
You can have virtually any number of Python environments, so it's easy to end up installing something somewhere and not having access from elsewhere.
Your specific use-case should inform how many Python environments you're using and what packages are installed in which one. Using a pre-built image allows developers to handle this environment management, ideally without you having to think about it.
pip install
And mindboggle itself does not appear to be able to be installed via pip.
Mindboggle can be installed via pip like
pip install git+git://github.com/nipy/mindboggle
If you want a specific version, you can add @«version» to the URL like pip install git+git://github.com/nipy/[email protected], and of course you can use any pip flags like --user.
HOWEVER, Mindboggle isn't supported outside of its published Docker and Singularity containers. That's not to say that it can't work, just that we don't have the capacity to debug in external environments. You are of course welcome to install, use and modify Mindboggle as you see fit, but if you're working outside of the published images, you are responsible for maintaining your own version.
getting a copy of Mindboggle in a Docker image
How would you recommend getting a copy of this library in a docker image? I don't want to use the existing mindboggle image as a base because I already have another image I am building off of. Hoping to hear that there is a line, or a couple of lines, I can add to my Dockerfile to install this without building off of the existing image.
If you're just trying to get Mindboggle itself into your Docker image and you have a Python requirements file, you can just add
git+git://github.com/nipy/mindboggle
(optionally with @«version», as above) as a line in your requirements file.
Depending on what you're doing with Mindboggle, you'll also need some-to-all of the dependencies installed in the official Mindboggle Dockerfile.


