3

I'm using the anaconda distribution of python, and the spyder IDE. Installing mayavi, via conda install mayavi, breaks spyder by downgrading numpy 1.10.4 -> 1.9.3 as seen via conda list --revisions. I can 'fix' this problem by manually upgrading numpy again, but I suspect there will be issues with Mayavi.

My question(s): Is there a better way to integrate Mayavi and spyder in anaconda? And, more generally, is there a recommended protocol for managing package dependencies? If installing mayavi hadn't broken the very next thing I used (spyder), it could have been quite difficult to track the source of this error. Actually, I thought package management was the value proposition of, say, the anaconda distribution...

(Related but different question arises here.)

Community
  • 1
  • 1
anon01
  • 10,618
  • 8
  • 35
  • 58

2 Answers2

1

I had the same issue and was using the same combinatation of tools.

The solution is to use conda environments. Environments are independent 'spaces' where you can install particular combinations of packages independent of the 'main' set of packages that are there somewhere else. Detailed article here

The workflow would basically involve this: Open Anaconda Prompt and setup a new conda environment for Mayavi ,eg. called 'mayavi_environment' :

conda create -n mayavi_environment python=(<PYTHONVERSION>)

where () is either 2.7,3.4 or which ever version you would like to create the environment with.

and once it's been created type :

activate mayavi_environment

Having done this then the necessary package dependencies need to be installed. I too had issues with spyder, and this was sorted out by completely uninstalling it and installing it afresh in the environment. Here is a bunch of solutions to running spyder from the created environment.

Thejasvi
  • 200
  • 1
  • 11
0

Installing mayavi is little bit complicated. It uses VTK, numpy==1.15.3 and traits lib which can't be compiled without VC2015. However you can find unofficial .whl files here: https://www.lfd.uci.edu/~gohlke/pythonlibs/

There are some ways to manage these dependencies. You can use pipenv: https://pipenv.readthedocs.io/en/latest/advanced/

https://virtualenvwrapper.readthedocs.io/en/latest/

Or you can use conda environments of course. Above are alternatives.