I just realized that I used the dock-pull to get the fmriprep docker image, it explains why I can’t use fmriprep-docker .
To run the fmriprep-docker wrapper, do I need to first delete the current fmriprep docker image? i.e., should I remove my current version of fmriprep and then use pip install --user --upgrade fmriprep-docker, or I can directly install without deleting the current docker image? (Assuming that the free space on my current drive is not that much).
Once installed, the fmriprep-docker wrapper has access to the different versions of the docker image (the ones you get with docker pull).
using fmriprep-docker <...> -i poldracklab/fmriprep:1.3.0.post2 you are indicating that you want to run fmriprep-1.3.0.post2, regardless the version of fmriprep-docker.
There is a subtlety here about the version: instead of using latest (which is the default when you don’t tell docker which version to be used), please always point to an existing version.
That is the best way of making sure you don’t introduce fmriprep version inconsistencies if you do not run all your subjects at once.
These things are annoying, sorry. It usually happens when you have a couple competing environments. I would recommend running the following several times until it says it can’t do anything:
pip uninstall fmriprep-docker
Then:
pip install --user fmriprep-docker
If that doesn’t work, you could try installing it without --user (uninstalling again, first). Assuming you have permissions to do it, it’s more likely to work.
This might be a deeper problem. You can try pip install --user --upgrade pip, but I have a suspicion that it’s just broken. There may be a better solution, but at that point, I would personally just delete my ~/.local directory and start from scratch.
I really just meant rm -r $HOME/.local. But note that that’s pretty drastic, and will remove a lot of things you have installed. If you’re content to reinstall things as you need them, then it should be fine. But you might be able to try something a little more confined like:
here are my docker images
hcp4715@hcp4715-Precision-5510:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nipy/heudiconv latest ee62aa995a80 3 weeks ago 1.27GB
poldracklab/fmriprep latest d4b288343142 4 weeks ago 11.6GB
hello-world latest fce289e99eb9 8 weeks ago 1.84kB
Your root user will have a different PATH than your own user, so fmriprep-docker will not show up to the root user. You can try:
sudo `which fmriprep-docker` ...
But that may not have the right PYTHONPATH environment to work with. The better solution is to give your user permission to run Docker images. See @oesteban’s comment here:
No, it’s just a different environment. You can probably resolve it by installing fmriprep-docker to your system-wide Python installation:
# Uninstall from user
pip uninstall fmriprep-docker
# Install using the default Python interpreter found by sudo
sudo python -m pip install fmriprep-docker
I will try to figure out the environment (s) first, seems a bit complicated. I only knew that conda can be used to set different environment, didn’t expect docker also related to env.
Mar 10th, 2019 update:
Finally, I could run fmriprep-docker.
I figured out that I set the python 3.6 from anaconda as my default, instead of directly installed by command from terminal. That caused the permission problem of pip upgrade problem. I solved it by modifying the permission of anaconda.