spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.11k stars 1.57k forks source link

Spyder Profiler save data crash #4994

Open Animadversio opened 6 years ago

Animadversio commented 6 years ago

Description

What steps will reproduce the problem?

  1. In Profiler Tab select a script file and run profiler
  2. the script has run to its end but there is nothing in profiler window (maybe very slow....)
  3. I try to "save data" in profiler tab, And the error pop up

What is the expected output? What do you see instead? I don't know the expected output of "save data" in profiler, for it never succeeds.

Please provide any additional information below

File "C:\Program Files\Anaconda3\lib\site-packages\spyder_profiler\widgets\profilergui.py", line 185, in save_data self.datatree.save_data(filename) File "C:\Program Files\Anaconda3\lib\site-packages\spyder_profiler\widgets\profilergui.py", line 479, in save_data self.stats1[0].dump_stats(filename) AttributeError: 'ProfilerDataTree' object has no attribute 'stats1'

Version and main components

Dependencies

pyflakes >=0.6.0 :  1.3.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
sphinx >=0.6.6   :  1.4.6 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  0.24.1 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
IPython >=4.0    :  5.1.0 (OK)
pylint >=0.25    :  1.5.4 (OK)
ccordoba12 commented 6 years ago

@Animadversio, thanks for reporting. We'll fix this in a future release.

cxcorp commented 3 years ago

Just experienced this myself while trying to profile Spyder itself on Spyder 4.1.4 (latest available from Anaconda Navigator on Windows?)

Steps to reproduce

  1. Start spyder with single-instance turned off
  2. Start other spyder with Run -> Profile
    from spyder.app import start
    start.main()
  3. Type something into a file
  4. Press Stop
  5. Notice that there's no profiling data in the profiler tab
  6. Press Save data
  7. Spyder has encountered an internal problem!
      File "C:\Users\user\anaconda3\lib\site-packages\spyder\plugins\profiler\widgets\profilergui.py", line 189, in save_data
        self.datatree.save_data(filename)
      File "C:\Users\user\anaconda3\lib\site-packages\spyder\plugins\profiler\widgets\profilergui.py", line 524, in save_data
        self.stats1[0].dump_stats(filename)
    AttributeError: 'ProfilerDataTree' object has no attribute 'stats1'

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.5.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=1.0                   :  2.5.3 (OK)
pyls >=0.34.0;<1.0.0           :  0.34.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.5 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.1.2 (OK)
spyder_kernels >=1.9.2;<1.10.0 :  1.9.2 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  0.29.21 (OK)
matplotlib >=2.0.0             :  3.2.2 (OK)
numpy >=1.7                    :  1.18.5 (OK)
pandas >=0.13.1                :  1.0.5 (OK)
scipy >=0.17.0                 :  1.5.0 (OK)
sympy >=0.7.3                  :  1.6.1 (OK)

EDIT: Sorry, I just ran "Reset Spyder settings" and am unable to reproduce this anymore. I was experiencing issues similar to #14823 and my native profiler pointed at psutil being blasted over and over again, with recurring runfile calls to a very heavy python script in my wdir (in the background, every 2 seconds, for some reason) so I figured I'd try resetting the settings before reinstalling the IDE. Which worked.