本文主要是介绍Python3.8上安装vtk和mayavi踩坑: Building wheel for mayavi (setup.py) ...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
用python3.7时,mayavi貌似很容易安装。
现在彩python3.8,发现安装时有下面的问题:
。。。。
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)
CCompilerOpt._cache_write[796] : write cache to path -> /tmp/pip-install-w8u16lpt/mayavi_956e846f839b4f7d95f69b7965bc3a4d/build/temp.linux-x86_64-3.8/ccompiler_opt_cache_ext.py
----------------------------------------
ERROR: Failed building wheel for mayavi
上网找了一下,说是要手动指定vtk和mayavi的版本,才能在python3.8的环境下安装成功。在Python3.7的环境下安装的vtk==8.1.2。Python3.9我没有试过,不知道情况。
说下我在Python3.8上安装mayavi的情况我摘录如下,
I'm seeing a stall as well during pip install of Mayavi 4.7.3 with VTK >= 9.0.2 (macOS 10.15, Python 3.6). Might be related to #1054, where the workaround was to install VTK 8.1.2. #1057 also reports a similar hang with VTK 9.0.3 (#1057 (comment)), whereas VTK 9.0.1 works, and this PR mentions issues with VTK 9.0.2. The workaround for me was also to pip install VTK 9.0.1 and Mayavi 4.7.3.
参考链接:
https://github.com/enthought/mayavi/issues/1055
也就是说,应该用下面的版本安装,
pip install vtk==9.0.1
pip install mayavi==4.7.3
我用上面这两条指令,在PYTHON3.8上安装成功。
这篇关于Python3.8上安装vtk和mayavi踩坑: Building wheel for mayavi (setup.py) ...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!