Python包安装——mayavi安装
来源:互联网 发布:杨君优化人生全本 编辑:程序博客网 时间:2024/05/29 12:04
深圳爱智慧科技有限公司 深度学习 人工智能 智能投顾 机器学习 中国版kensho 深圳爱智慧科技有限公司
安装mayavi有两种方法:
一种是安装集成了多个python包的软件,如 Enthought Canopy, Pythonxy, orAnaconda.但是貌似几个集成环境中都没有看到mayavi的影子。
第二种就是从源代码开始安装:安装mayavi之前先要安装这几个依赖包
You must have the following libraries installed before installing the Mayavi project:
- Numpy version 1.1.1 or later
- VTK version 5.0 or later
- wxPython version 2.8 or later
- configobj
一:
首先安装vtk:
安装VTK,从网站http://www.vtk.org/VTK/resources/software.html 下载最新版本,此文安装的是:vtkpython-6.1.0-Windows-64bit.exe
3)配置VTK环境变量:
A:把VTK中的bin文件加入系统变量中:如:PATH:C:\Program Files\VTK 6.1.0\bin
B:设置python路径,在系统变量中创建PYTHONPATH :如:PYTHONPATH :C:\Program Files\VTK 6.1.0\bin;C:\Program Files\VTK 6.1.0\bin\Lib\site-packages
4)测试,打开python IDEL界面,输入:import vtk
>>> import vtk
>>>
没报错,就说明安装成功了。
我是直接把site-packages里面的vtk拷贝到了python27下面的site-packages中
安装VTK的第二种方法,从源代码开始安装(需要先编译VTK,由于是win10系统没成功)
好吧,装了了vtk之后再到mayavi-4.4.3文件夹下运行python setup.py install 还是不成功。
于是又老老实实看了Enthought Canopy发现vtk,tvtk还有traits啥的还是有的,尽管就是没有mayavi,先装个Canopy,然后把把site-packages里面的vtk拷贝到了python27下面的site-packages中
我擦,不科学,怎么会这样
特么竟然有了,有了!!!!!!直接考到python27下面的site-packages中
import mayavi.mlab as mlab
遇到ValueError: cannot set toolkit to wx because it has already been set to qt4的问题
从这个网址看到的解决方案
Hi,
Building traitsui GUIs from the ipython notebook should work the same as from a regular ipython console. The difference between configure_traits and edit_traits is that the first one creates a GUI event loop before building the traitsUI window in it. That's what makes it responsive or not. Alternatively you can manually start the GUI event loop by specifying --gui=?? when you create ipython, for example:
ipython notebook --gui=wx
Then you should use edit_traits() and the UI element will be responsive.
Finally, ETSConfig allows you to set the backend at your script runtime instead of when you start python/ipython. This is what I do the most so that I don't need to set the value of the ETSConfig environment variable, or set the gui switch when starting python/ipython.
To conclude, the following code is what I do the most and works from within the ipython notebook started with ipython notebook (version 0.13):
from traits.etsconfig.api import ETSConfig
ETSConfig.toolkit = 'qt4'
from traits.api import HasTraits, Enum
from traitsui.api import View
class A(HasTraits):
x = Enum(["foo","bar"])
a = A()
a.configure_traits()
HTH,
Jonathan
Thanks, Jonathan.
---------------------------------------------------------------------------ValueError Traceback (most recent call last)<ipython-input-2-8a5daaa83ef1> in <module>()----> 1 ETSConfig.toolkit = 'qt4'/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/traits/etsconfig/etsconfig.py in _set_toolkit(self, toolkit) 208 if self._toolkit and self._toolkit != toolkit: 209 raise ValueError, "cannot set toolkit to %s because it has "\--> 210 "already been set to %s" % (toolkit, self._toolkit) 211 212 self._toolkit = toolkitValueError: cannot set toolkit to qt4 because it has already been set to wx
================================================================================================================================
下面是一个例子
运行这个例子提醒没有安装“ffmpeg.win32.exe”
从https://github.com/imageio/imageio-binaries/blob/master/ffmpeg/ffmpeg.win32.exe下载了个“ffmpeg.win32.exe”文件。
然后在用户和系统环境变量里面新建一个名字叫“IMAGEIO_FFMPEG_EXE”,值是你存放这个exe文件的地址的变量。
- Python包安装——mayavi安装
- python下vtk及mayavi的安装
- Linux python3 安装Mayavi
- 如何安装mayavi(以python 3.5为例)
- win7 Python3 安装mayavi 记录
- Ubuntu下 python3 安装Mayavi
- python包安装——jcc安装
- mayavi作图指南0-mayavi在python3下的安装
- Python MayaVi
- 9. 总结及Mac安装Mayavi经验
- anacoda python3.4如何安装mayavi
- python包安装——Swig
- python——pip安装包教程
- caffe安装系列——安装python依赖包
- caffe安装系列——安装python依赖包
- Python包安装:PYHDF安装
- python制作安装包
- Python包的安装
- Assembly x64 Intro - SSE2 IDCT
- 第八周 项目三 顺序串算法(2)
- linux 关机重启 shutdown和reboot的区别
- HDOJ 1563 Find your present!
- ucosIII 系统任务
- Python包安装——mayavi安装
- 第10周 【项目2 - 二叉树遍历的递归算法】
- Assembly x64 Intro - SSE2 IDCT I16X16 DC
- 创业者融资攻略:什么时候可以“视金钱如粪土”?
- [转]在SpringMVC中获取request对象的几种方式
- 【代码笔记】iOS-传身份证号码可返回生日字符串
- 第16周项目1-选择排序之堆排序(6)
- 第14周项目1-(2)验证分块查找算法
- LeetCode-7-Reverse Integer(Nmber-Strng)-Easy