enthought

enabled_when listening outside model object

和自甴很熟 提交于 2019-12-08 05:24:49
问题 I found a workaround to my original problem but I am hoping someone else can explain what is going on. I originally noticed that enabled_when , and I'd imagine visible_when also, appears to take effect in response to trait events originating from the model object only. If the event originates from some other object, even if the editor refers to it, it doesn't seem to be propagated correctly. class DirectObjectPronoun(HasTraits): text=Str typable=Bool(False) traits_view=View( Item(name=

Multi Object View Behaviour - Creating an Editor for a HasTraits subclass

北战南征 提交于 2019-12-08 04:28:39
问题 I am currently trying to make a traitsUI GUI for a class that contains many instances of a single object. My problem is very similar to the one solved in MultiObjectView Example TraitsUI. However, I don't like the idea of using a context as it requires me to write out the same view many times for each object I have (and I might have a lot). So I tried to edit the code to make it so that each Instance of the House object would default to looking like its normal view when it is viewed from the

Matplotlib import error ft2font

拈花ヽ惹草 提交于 2019-12-08 03:43:45
问题 I have Python 2.7.6 installed under Canopy on a 64 bit Mac with Ipython version 2.1.0. This is a really odd problem and I'm not sure if it is a path file problem. Whenever I import matplotlib.pyplot (not just matplotlib), I receive the following error: In [2]: import matplotlib.pyplot as plt --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-eff513f636fd> in <module>() ----> 1 import matplotlib.pyplot as

python example app hangs on close

为君一笑 提交于 2019-12-08 03:23:49
问题 I am relatively new to python and completely new to vtk, so I started with the Camera.py example program from the vtk.org website. Running Enthought Canopy 1.4.1.1975 on Mac OSX 10.9.4 the example program runs but hangs the python interpreter on close with the following error. The kernel (user Python environment) has terminated with error code -11. This may be due to a bug in your code or in the kernel itself. I simplified the example program down to the following and still observe the same

How can I use Pyqt with Enthought Canopy

和自甴很熟 提交于 2019-12-08 02:27:30
问题 I had EPD installed and am giving Canopy (Windows 7 64-bit, Academic license) a go. When I first started Canopy, nothing happened (no GUI, no error message) and I realized this is because I had QT_API set to pyqt. Changing qt_api to pyside allows me to start Canopy. After doing this I have checked that pyqt is installed through the Canopy package manager. However Canopy refuses to start with QT_API set to pyqt. How can I fix this? I have a big project with everything in pyqt, so I want to use

Installing a package to Canopy

て烟熏妆下的殇ゞ 提交于 2019-12-07 14:18:08
问题 I'm really new to coding, programming, Python, and just computers in general, so I need some help with Canopy. I've been having pretty consistent troubles installing any packages to Canopy; some stuff is in the internal package manager,but whenever it isn't, it's really confusing. I guess I'll list a specific installation. I'm trying to install "pywcs" (link provided below) to my Win7 64-bit machine. I have Cygwin if that helps at all. I do not know how to go about this; the stuff I found

Installing python module “rpy2” after installing Enthought Canopy

a 夏天 提交于 2019-12-07 09:44:18
问题 Some of my python scripts use rpy2 as an interface to R, which worked perfectly with the previous Enthought EPD python. I recently installed Canopy Python from Enthought. Python now no longer finds the rpy2 module, and when I try to reinstall it, I get the following errors: $ easy_install rpy2 [...] Processing rpy2-2.3.5.tar.gz Writing /var/folders/9n/qk8wf11d205b0lrr57wyg7k80000gp/T/easy_install-HIclIh/rpy2-2.3.5/setup.cfg Running rpy2-2.3.5/setup.py -q bdist_egg --dist-dir /var/folders/9n

Vim shows: ImportError: No module named site. while I am using Canopy1.1

大兔子大兔子 提交于 2019-12-07 09:01:10
问题 I have installed Canopy 1.1 express in Windows Xp 32, and I use vim as editor. When I typing :python print("hello") in command line of vim ,it shows: Importerror: No module named site and crashed. In fact, my vim cannot load and plugin written by python(such as jedi-vim), and cannot execute any statements written in python. I have set the PYTHONHOME and PYTHONPATH as " User Python Environment ", and have read the answer in stackoverflow. In fact, I can use python, it works well. If I remove

python example app hangs on close

泄露秘密 提交于 2019-12-07 02:49:25
I am relatively new to python and completely new to vtk, so I started with the Camera.py example program from the vtk.org website. Running Enthought Canopy 1.4.1.1975 on Mac OSX 10.9.4 the example program runs but hangs the python interpreter on close with the following error. The kernel (user Python environment) has terminated with error code -11. This may be due to a bug in your code or in the kernel itself. I simplified the example program down to the following and still observe the same behavior. import vtk #Create a renderer, render window, and interactor renderer = vtk.vtkRenderer();

How can I fire a Traits static event notification on a List?

风流意气都作罢 提交于 2019-12-07 01:50:51
问题 I am working through the traits presentation from PyCon 2010. At about 2:30:45 the presenter starts covering trait event notifications, which allow (among other things) the ability to automatically call a subroutine any time a trait has changed. I am running a modified copy of the example he gave... In this trial, I am trying to see whether I can fire a static event whenever I make a change to volume or inputs . from traits.api import HasTraits, Range, List, Float import traits class