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

Importing mindboggle #207

Open
butellyn opened this issue Mar 19, 2021 · 1 comment
Open

Importing mindboggle #207

butellyn opened this issue Mar 19, 2021 · 1 comment

Comments

@butellyn
Copy link

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.

@shnizzedy
Copy link
Member

"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 install with the --user flag installs the dependencies for the current user in the .local/bin directory 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

here (separate environments)

to

here (environment A)orhere (environment B)

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.

Python Environment
XKCD 1987: Python Environment

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/mindboggle@v1.3.8, 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.

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

No branches or pull requests

2 participants