简体   繁体   中英

Install Mayavi for Python 3.7.1 in Windows 10

Under Windows 10, I'm trying to run a Python script which contains the line

from mayavi import mlab

Therefore I'm trying to install Mayavi by running

pip install mayavi

from the Windows PowerShell. I then get

Collecting mayavi
  Using cached https://files.pythonhosted.org/packages/83/9e/293ba57353ed258c2f64d54bf00ca1447c1f38f4eb60d0e762ddec57bf51/mayavi-4.6.2.tar.bz2
Collecting apptools (from mayavi)
  Using cached https://files.pythonhosted.org/packages/78/84/64764e2c87fcb7ad7521bdabc7c44c109b80691f94218cbddd5df2ee682c/apptools-4.4.0.tar.bz2
Collecting envisage (from mayavi)
  Using cached https://files.pythonhosted.org/packages/ea/2a/7efcd2c44a638a5e3e65e39f7e5bd4cf952ef4ffc71768730cf19fef1e4e/envisage-4.7.0-py3-none-any.whl
Requirement already satisfied: numpy in c:\users\adria\appdata\local\programs\python\python37-32\lib\site-packages (from mayavi) (1.15.4)
Collecting pyface>=6.0.0 (from mayavi)
  Using cached https://files.pythonhosted.org/packages/45/fe/7150742f7053cb5082f15704c064a5c683f42dfc00411ce173287651e33a/pyface-6.0.0.tar.gz
Collecting pygments (from mayavi)
  Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Collecting traits>=4.6.0 (from mayavi)
  Using cached https://files.pythonhosted.org/packages/56/47/03f50e82e1ff1e8a602c5f2cf12f08675f79a7169629fe4ce521e59d265f/traits-4.6.0.tar.bz2
Collecting traitsui>=6.0.0 (from mayavi)
  Using cached https://files.pythonhosted.org/packages/f2/06/3ad35a78e1ca82d762e2d9ffe9ed6c9dd405caa340066052d7ec186b9b1b/traitsui-6.0.0.tar.gz
Collecting vtk (from mayavi)
  Could not find a version that satisfies the requirement vtk (from mayavi) (from versions: )
No matching distribution found for vtk (from mayavi)

Running pip install vtk gives

Collecting vtk
  Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk

I installed VTK manually with https://www.vtk.org/files/release/7.1/vtkpython-7.1.1-Windows-64bit.exe but it does not solve the problem.

Running python --version returns Python 3.7.1 and running pip --version or pip3 --version returns pip 18.1 from c:\\users\\adria\\appdata\\local\\programs\\python\\python37-32\\lib\\site-packages\\pip (python 3.7) .

How do I solve this problem?

Go to anaconda cloud then search mayavi then, in the python console, tape

conda install -c conda-forge mayavi 

Perhaps before you have to install VTK module with

conda install -c conda-forge vtk 

Then restart the console, and enjoy!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM