Luispain
Luispain

Reputation: 41

pyinstaller and matplotlib gets maximum recursion depth exceeded

This is my what I'm using:

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

Upvotes: 4

Views: 4541

Answers (1)

Kirill Dolmatov
Kirill Dolmatov

Reputation: 327

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 

Upvotes: 3

Related Questions