How can I install mayavi on Windows for python 3 via conda?

巧了我就是萌 提交于 2019-12-12 14:17:28

问题


I have a python 3 virtual environment managed by conda on Windows. I want to install the mayavi package via

conda install mayavi

but it says it requires python 2.7.


回答1:


Have your luck with a mayavi package available on other channels, by searching on the Anaconda website.

As of today, the one maintained on the conda-forge channel is compatible with python 3.5 and 3.6. To install it,

conda install -c conda-forge mayavi

If mayavi fails with an

ImportError: Could not import backend for traits

it may be because qt is not installed or that qt5 is installed -- in that case it needs to be downgraded

conda install pyqt=4



回答2:


Here is something you can try:

If you have Visual Studio installed, and Python Native Development Tools installed.

In Anaconda3, you can get VTK7.1.x from clinicalgraphics

conda install -c clinicalgraphics vtk

Open up the VS20xx x64 Native Command Prompt, setting up PATH for python properly: e.g.

C:\Anaconda3\Scripts\activate.bat C:\Anaconda3

Then install mayavi using pip from source.

pip install mayavi

It compiles successfully with VS2017 and Python 3.6 in windows 10.



来源:https://stackoverflow.com/questions/45167824/how-can-i-install-mayavi-on-windows-for-python-3-via-conda

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