Spyder together with Mayavi

北慕城南 提交于 2019-12-24 06:47:51

问题


Is it possible to use a different IDE as a front end while using the Canopy EPD engine in the back end? In particular, I'd like to use mayavi.mlab scripting from Spyder's ipython interpreter. I'm working on a macbook pro running OSX 10.8. Is there a way to set this up?

I have tried to set up mayavi and spyder using macports, but that does not seem to work. The only working version of mayavi that I have managed to set up runs from the commercial Canopy platform. So if I can't get the macports mayavi to work with the macports spyder, I am hoping to get the Canopy mayavi working with spyder.

Thanks.

Adrian


回答1:


(Spyder dev here): This is what you need to do:

  1. Run this command in a console

    enpkg ipython update
    
  2. Go to

    Spyder > Preferences > Console > Advanced Settings > Python Executable
    
  3. Select the option

    Use the following interpreter
    

    Note: This option is not available right now but it will be in 2.2.3. If it's not, then just the text field present there.

  4. Put there the full path to Canopy's Python version, which you can get with these commands inside Canopy:

    In [10]: import sys
    
    In [11]: sys.executable
    Out[11]: '/home/carlos/Enthought/Canopy_64bit/User/bin/python'
    



回答2:


Maybe I'm missing what you want to do (I don't even know what mayavi is), but here's something you can try. I'm using Spyder (version 2.2.1 ) with the Canopy EPD distribution (version 1.0.3) Try doing this:

1) At the command line, update ipython with the enpkg command ( "enpkg ipython update" should work) In my case, this reverted the ipython to ipython-0.13.1-2 2) Then in Spyder, go to preferences -> Console -> Advanced Settings and in the python executable put something like /Users//Library/Enthought/Canopy_64bit/User/bin/python

Restart Spyder and now you should be able to use the EPD distribution with all the modules you have installed.



来源:https://stackoverflow.com/questions/18329149/spyder-together-with-mayavi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!