在Windows 10下,我正在尝试运行一个包含该行的Python脚本
from mayavi import mlab
因此,我正在尝试通过运行
来安装mayavipip install mayavi
来自Windows PowerShell。然后我得到
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:usersadriaappdatalocalprogramspythonpython37-32libsite-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)
运行pip install vtk
给出
Collecting vtk
Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk
我用https://www.vtk.org/files/release/7.1/vtkpython-7.1.1-Windows-64bit.exe
手动安装VTK,但不能解决问题。
运行python --version
返回Python 3.7.1
并运行pip --version
或pip3 --version
返回pip 18.1 from c:usersadriaappdatalocalprogramspythonpython37-32libsite-packagespip (python 3.7)
。
如何解决此问题?
转到anaconda云,然后搜索mayavi,然后在python控制台中,磁带
conda install -c conda-forge mayavi
也许在您必须使用
安装VTK模块之前conda install -c conda-forge vtk
然后重新启动控制台,享受!