mkrphys / ipython-tikzmagic

IPython magics for generating figures with TikZ
BSD 3-Clause "New" or "Revised" License
160 stars 44 forks source link

issues Jupyter notebook and python 3 #1

Closed marvey99 closed 8 years ago

marvey99 commented 9 years ago

Hi there, I was hoping to use this wonderful package. Despite installing the magic successfully, I get the following error when I do the example in test notebook %load_ext tikzmagic %tikz \draw (0,0) rectangle (1,1);

FileNotFoundError Traceback (most recent call last) /Users/doyley/.ipython/extensions/tikzmagic.py in tikz(self, line, cell, local_ns) 312 try: --> 313 image = open(image_filename, 'rb').read() 314 plot_mime_type = _mimetypes.get(plot_format, 'image/%s' % (plot_format))

FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/wm/6wqst9v111d8ctzs3sddl5c80000gn/T/tmp_kh336sf/tikz.png'

During handling of the above exception, another exception occurred:

TypeError Traceback (most recent call last)

in () ----> 1 get_ipython().magic('tikz \draw (0,0) rectangle (1,1);') //anaconda/lib/python3.4/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s) 2302 magic_name, _, magic_arg_s = arg_s.partition(' ') 2303 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) -> 2304 return self.run_line_magic(magic_name, magic_arg_s) 2305 2306 #------------------------------------------------------------------------- //anaconda/lib/python3.4/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line) 2223 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals 2224 with self.builtin_trap: -> 2225 result = fn(_args,_*kwargs) 2226 return result 2227 /Users/doyley/.ipython/extensions/tikzmagic.py in tikz(self, line, cell, local_ns) //anaconda/lib/python3.4/site-packages/IPython/core/magic.py in (f, _a, *_k) 191 # but it's overkill for just that one bit of state. 192 def magic_deco(arg): --> 193 call = lambda f, _a, *_k: f(_a, *_k) 194 195 if callable(arg): /Users/doyley/.ipython/extensions/tikzmagic.py in tikz(self, line, cell, local_ns) 319 320 except IOError: --> 321 print >> sys.stderr, "No image generated." 322 323 # Copy output file if requested TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and 'OutStream'