Hi, this is weird, and I know it has worked a couple of days ago. I am puzzled and not sure what to check anymore. I am running the MacPorts Python installation
which python in terminal gives /opt/local/bin/python
In Textmate, I have the following Shell Variables set: TM_PYTHON = /opt/local/bin/python PYTHONPATH = /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
When I run the script shown below from terminal using python testscript.py the matplotlib window pops up, and all is good. When I run the script from within TextMate using cmd-R the script runs fine unitl just before the plt.figure() line. Then in the dock the "python rocket" symbol launches, but no Matplotlib window pops open, no error message, just the bouncing python rocket.
I tried changing backends in the matplotlibrc, but only "MacOSX" results in no error message, which is what I have previously used.
What could the reason be why matplotlib doesn't work anymore from within TextMate?
Thanks for your help! Cheers, Claus
import matplotlib.pyplot as plt import numpy as np import scipy.special as sps
# create x-array t = np.arange(-3.0, 3.0, 0.01) # create y-array x = sps.erf(t)
# print x-array vs. y-array fig = plt.figure() ax = fig.add_subplot(111) ax.plot(t, x) plt.show()
# printx-array and. y-array, just to see something print t print x print "done! Yay!"
On Jul 5, 2010, at 12:02 PM, Claus wrote:
Hi, this is weird, and I know it has worked a couple of days ago. I am puzzled and not sure what to check anymore. I am running the MacPorts Python installation
which python in terminal gives /opt/local/bin/python In Textmate, I have the following Shell Variables set: TM_PYTHON = /opt/local/bin/python PYTHONPATH = /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
When I run the script shown below from terminal using python testscript.py the matplotlib window pops up, and all is good. When I run the script from within TextMate using cmd-R the script runs fine unitl just before the plt.figure() line. Then in the dock the "python rocket" symbol launches, but no Matplotlib window pops open, no error message, just the bouncing python rocket.
I ran into similar troubles with matplotlib: http://old.nabble.com/still-problems-with-matplotlib-td27098116.html
If I remember correctly, TextMate has had some issues with interactive input since the change to Snow Leopard. Alex Ross ended up giving me a couple of solutions that worked for me: 1) Set TM_INTERACTIVE_INPUT_DISABLED=true in TextMate's shell variables preference pane 2) Remove (or rename) tm_interactive_input.dylib, which is located somewhere in your support path (refer to thread to see where I found my copies).
Best, -Tony