Get mayavi working with Python 3

非 Y 不嫁゛ 提交于 2019-11-30 08:54:25

Mayavi can work with python 3 now. You will need VTK 7.0 or higher compiled for python 3 support. Then you can just install mayavi with pip. pip install mayavi

Installing vtk may prove somewhat difficult. You need to make sure to change the PYTHONPATH variable, and build vtk with tcl, tk, and python 3 support.

I was able to get Mayavi2 to work with Python 3.6.4.

To set up Mayavi on ubuntu, do the following -

  • Install Anaconda/Miniconda distribution of python depending on your needs(I used Miniconda 4.3.30). For more info look here
  • Run the following in terminal -

        apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 gtk3.0
        conda install -y -c conda-forge qt vtk pyvtk pyside envisage mesalib mayavi
        conda install -y -c ajsrk traitsui
    

    Ideally , you wouldn't need the last line since traitsui will be installed as part of the dependencies in the previous step. However, I found an issue with this version of traitsui. So as a temporary fix, I have uploaded my version of traitsui into anaconda cloud; this can be used until the fix finds its way into the next release and is available in the conda-forge channel

To verify the installation start a terminal session and type 'mayavi2'

The best solution that I`ve found, is this. Even though, Mayavi will only work on Pyathon 3.5...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!