4
votes

This is my what I'm using:

  • Python 3.4.3 windows distribution "Anaconda 2.2.0 (64-bit)".
  • Matplotlib version 1.4.3
  • Numpy version 1.6
  • Pyinstaller version 3.0.dev0-py3.4

When I try to make an executable of a python file that makes a matplotlib figure, it issues a "maximum recursion depth exceeded". The code I want to compile is:

import matplotlib.pyplot as plt

x = [0, 1, 2, 3, 4]
y = [0, 1, 4, 9, 16]

plt.plot(x, y)
plt.show()

I compile it using:

pyinstaller -F plottest.py

But I get the following error:

...
File "C:\Anaconda3\lib\ast.py", line 245, in visit
  return visitor(node)
File "C:\Anaconda3\lib\ast.py", line 255, in generic_visit
  self.visit(value)
File "C:\Anaconda3\lib\ast.py", line 245, in visit
  return visitor(node)
File "C:\Anaconda3\lib\ast.py", line 249, in generic_visit
  for field, value in iter_fields(node):
RuntimeError: maximum recursion depth exceeded

Full traceback located here: http://pastebin.com/3b62W1Lb

1
Thank you for your reply. Just checked the units.py file and the bug you mention is already fixed in my version (matplotlib 1.4.3). - Luispain
What as at the top of the call stack? - asmeurer
I added the full traceback: pastebin.com/3b62W1Lb - Luispain

1 Answers

3
votes

Create a spec file

pyi-makespec options name.py 

Modify this spec by adding to start of file

import sys
sys.setrecursionlimit(5000) # or more

Build the executable file

pyinstaller options name.spec