问题
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