Host.'s blog

By Host., 12 years ago, In English

Hello everyone,

I'm trying to make a graph using matplotlib.pyplot and subprocess, but I get the following error:

Traceback (most recent call last):
    File "subprocess.py", line 2, in <module>
        import matplotlib.pyplot as plt
    File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 105, in <module>
        import os, re, shutil, subprocess, sys, warnings
    File "/home/igor/Documentos/subprocess.py", line 2, in <module>
        import matplotlib.pyplot as plt
    File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 20, in <module>
        from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name interactive

Error in sys.excepthook:

Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
        from apport.fileutils import likely_packaged, get_recent_crashes
    File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
        from apport.report import Report
    File "/usr/lib/python2.7/dist-packages/apport/report.py", line 12, in <module>
        import subprocess, tempfile, os.path, urllib, re, pwd, grp, os
    File "/home/igor/Documentos/subprocess.py", line 2, in <module>
        import matplotlib.pyplot as plt
    File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 20, in <module>
        from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name _pylab_helpers

If I try to do a graph not using subprocess (just plotting 2 arrays as axes), I don't get this problem.

Can someone help me?

  • Vote: I like it
  • +5
  • Vote: I do not like it