I'm having some problems following the tutorial found here: http://www.scipy.org/site_content/tutorials/plot_tutorial In particular, when in the Python interpreter I do >>> import gui_thread nothing seems to happen - I simply get an interpreter prompt. I took a look at gui_thread/__init__.py, and it appears that there are only import statements - is there something that I'm missing? I noticed that in a previous version of __init__.py there was a call to main.start(), so I tried re-inserting that into the file, but this simply hangs the interpreter. (The interpreter must be killed from another terminal). What is somewhat odd is that if I leave the code as is (i.e., without the explicit call to main.start()), and do: >>> import gui_thread >>> gui_thread.main.start() Things seem to work as advertised. I.e., <Importing wxPython... done.> >>> from scipy import plt >>> plt.plot(range(3)) <scipy.plt.wxplt.plot_frame instance; proxy of C++ wxFrame instance at _8664858_wxFrame_p> >>> shows an appropriate window. Is there a reason why calling main.start() from the interpreter behaves differently then when called from within the __init__.py? (I realize the contexts are different, but having looked at what main.start() does, it's not clear to me why that would matter). On a separate note, trying to use Chaco results in the following:
from chaco import wxplt Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.2/site-packages/chaco/wxplt.py", line 19, in ? from wxplot import * File "/usr/local/lib/python2.2/site-packages/chaco/wxplot.py", line 17, in ? from wxplot_window import PlotWindow, PlotTraitSheet File "/usr/local/lib/python2.2/site-packages/chaco/wxplot_window.py", line 25, in ? from wxplot_trait_sheet import TraitPanel, TraitSheet, trait_sheet_handler File "/usr/local/lib/python2.2/site-packages/chaco/wxplot_trait_sheet.py", line 18, in ? from traits.wxtrait_sheet import * File "/usr/local/lib/python2.2/site-packages/traits/__init__.py", line 20, in ? from traits import HasTraits, HasDynamicTraits, Trait, Disallow, \ File "/usr/local/lib/python2.2/site-packages/traits/traits.py", line 100, in ? from trait_delegates import TraitDelegate File "/usr/local/lib/python2.2/site-packages/traits/trait_delegates.py", line 38, in ? class TraitDelegate: File "/usr/local/lib/python2.2/site-packages/traits/trait_delegates.py", line 40, in TraitDelegate def __init__ ( self, delegate = None, mutate_or_prefix = False ): NameError: name 'False' is not defined
Does one need Python 2.3 to use Chaco? (I know that wxPython uses 'True' and 'False' without requiring 2.3 - I believe it's dynamically bound when one does 'import wx'?) Thanks in advance for any insight, d Some system info follows: ------ os.name='posix' ------ sys.platform='linux2' ------ sys.version: 2.2 (#1, Feb 26 2002, 15:49:15) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] ------ sys.prefix: /usr/local ------ Found Numeric version '21.3' in /usr/local/lib/python2.2/site-packages/Numeric/Numeric.pyc ------ Found f2py2e version '2.35.229-1492' in /usr/local/lib/python2.2/site-packages/f2py2e/f2py2e.pyc ------ Found scipy_distutils version '0.2.0_alpha_3.288' in '/usr/local/lib/python2.2/site-packages/scipy_distutils/__init__.pyc' Importing scipy_distutils.command.build_flib ... ok ------ atlas_info: FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/local/lib'] blas_info: FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] blas_src_info: NOT AVAILABLE dfftw_info: NOT AVAILABLE dfftw_threads_info: NOT AVAILABLE djbfft_info: NOT AVAILABLE fftw_info: FOUND: libraries = ['rfftw', 'fftw'] library_dirs = ['/usr/local/lib'] define_macros = [('SCIPY_FFTW_H', None)] include_dirs = ['/usr/local/include'] fftw_threads_info: NOT AVAILABLE lapack_info: FOUND: libraries = ['lapack'] library_dirs = ['/usr/local/lib'] lapack_src_info: NOT AVAILABLE sfftw_info: NOT AVAILABLE sfftw_threads_info: NOT AVAILABLE x11_info: FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] ------ Gnu version='0.5.26' F77='g77' F77FLAGS=' -Wall -fno-second-underscore -fPIC ' F77OPT=' -O3 -funroll-loops -march=i686 -malign-double -fomit-frame-pointer ' LIBS='-lg2c'
daishi@egcrc.net reported problems with gui_thread under linux. I have been having the same problem in XP. The only way I can use chaco.wxplt is to run it from PyCrust. Also, I cannot run anything from chaco.tkplt at all. The begining of the error stream is reproduced below. About twice this amount of additional errors follows after. I had been having other problems with my XP installation, so I thought that something was screwed up in my system. (supported by a lack of similar reports here) . I was about to reformat my hard drive when I decided to do a completely fresh python installation on an NT machine that never had python on it. I get *exactly* the same results. No difference between Numeric 22.0 and Numeric 23.0 Perhaps there's something I should have installed ????? I'm perplexed that I've seen no mention of these problems, yet I have it on two different machines with two different OSs. off topic, but maybe related: I frequently get a windows error concerning an unreadable memory location when I close a Tkinter app. Idle and Idlefork always give this error when closing. On both XP and NT. I'm happy to provide whatever info you want ... just tell me what you need. I have posted this problem on the chaco list but I've gotten no responses. Any takers? Gary
from chaco import tkplt tkplt.plot((1,2,3)) Traceback (most recent call last): File "C:\PYTHON22\Lib\site-packages\chaco\plot_window.py", line 227, in _min_size dx, dy = canvas._min_size() File "C:\PYTHON22\Lib\site-packages\chaco\plot_canvas.py", line 619, in _min_size title_info = self._title_info() File "C:\PYTHON22\Lib\site-packages\chaco\plot_canvas.py", line 596, in _title_info return TitleInfo( self._titles ) File "C:\PYTHON22\Lib\site-packages\chaco\plot_info.py", line 67, in __init__ self.add_titles( titles ) File "C:\PYTHON22\Lib\site-packages\chaco\plot_info.py", line 76, in add_titles self.min_size( title_item ) File "C:\PYTHON22\Lib\site-packages\chaco\plot_info.py", line 94, in min_size dx, dy = title._min_size() File "C:\PYTHON22\Lib\site-packages\chaco\plot_frame.py", line 515, in _min_size ( min_dx, min_dy, File "C:\PYTHON22\Lib\site-packages\kiva\basecore2d.py", line 1266, in get_full_text_extent return self.device_get_full_text_extent(textstring) File "C:\PYTHON22\Lib\site-packages\kiva\basecore2d.py", line 1274, in device_get_full_text_extent ft_engine.select_font( f.name, f.size, f.style, f.encoding ) ### TEMPORARY ### AttributeError: Font instance has no attribute 'name'
participants (2)
-
daishi@egcrc.net -
Gary Pajer