Easy Installation for PyMVPA
Edit/Sidenote: I should mention another alternative, containers (Docker, Singularity), which allow you to download and enter an environment much like a virtual machine but less clunky. Pros are software already all set up and running with all dependencies, and an isolated contained environment, Cons are significantly more space requirements and installation debugging issues, which are significantly more complex on Windows. See here (with PyMVPA plus Jupyter notebooks) and here (no PyMVPA but great tutorial/resources) for examples of installation, and additional options such as barebones PyMVPA the Neurodebian OS here. Tutorial on containers here.
We recently held a workshop for PyMVPA, in which I was quickly reminded that installation is hell outside of Linux (Windows, Mac OS). From issues with Macports, inconvenience of virtual machines, and various dependency debuggings that come with the Py 2.6 Windows installer and source code, it just is not too pleasant at the moment for most folk I talk to. So, we found 2-minute, easy solutions that worked across a bunch of our machines. See instructions below, and some troubleshooting notes as well. (Pulled together via the Freeman lab, thanks Jon et. al for the notes).
Mac OS
- Download and install Anaconda for Python 2.7 for Mac from Anaconda site.
- Install PyMVPA with Anaconda: (update: new conda call
conda install -c conda-forge pymvpa2
*Alternatively, search the Anaconda cloud for other versions if you run into problems.
*See notes at the bottom for some common debugging solutions
Windows
- Download and install Anaconda for Python 2.7 for Windows.
- Download the PyMVPA 'wheel' file 2.6.1 for python 2.7 (32 vs 64 bit depending on your machine).
E.g., pymvpa2‑2.6.1‑cp27‑cp27m‑win_amd64.whl (version 2.6.1, Python 2.7, 64 bit)
Backups for 32-bit and 64-bit <-- here. - Install the file with pip via the 'Anaconda Prompt' runner that was setup when you installed Anaconda (search for it if necessary):
*If having trouble finding the prompt, it should just be cmd.exe (search 'cmd') executing something like: %windir%\system32\cmd.exe "/K" C:\ProgramData\Anaconda2\Scripts\activate.bat C:\ProgramData\Anaconda2 . So dig around there and online as to how to initiate the prompt with access to pip.pip install '[filepath to .whl file]' # for example, assuming it is in the working directory: pip install pymvpa2‑2.6.1‑cp27‑cp27m‑win_amd64.whl
- Alternatively, maybe, conda:
conda install pymvpa2
Additional tips:
- If you originally had a different version of Python installed, see this link about using Anaconda to make an environment in Python 2.7 in which you can use PyMVPA. Remember you need to activate this environment in each terminal session any time you want to use PyMVPA, or better, set it as your environment because Python 3 is stoopid.
- Anaconda may not have set up all dependencies, such as nibabel (I hear this happens on Mac). So, if you run into dependency import problems, install all these packages as well (not sure if they can both come from either conda or pip, so...):
conda install mayavi pyqt matplotlib numpy scipy ipython statsmodels networkx # and.... pip install scikit-learn nipy nibabel pycortex pymc # some people had trouble with this specific set on Macs: conda install -c conda-forge libsvm conda install -c conda-forge nibabel
- Alternatively, things might not be up-to-date, causing problems! In which case, update them (don't update all if you need certain ones not updated!). Google updating Anaconda and Pip, I'd provide here but you should check most proper way to do this.
Hope that helps! Please contact me if you run into problems, and also if you solve any of your problems so we can put a note here. Thanks!