Spyder: Error when attempting to inspect array with special dtype

Created on 31 Jan 2019  路  9Comments  路  Source: spyder-ide/spyder

Problem Description

What steps will reproduce the problem?

Created np.dtype, assigned np.dtype to array. Attempted to open array from variable explorer and got "Spyder has encountered an internal problem.

Traceback

  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\collectionseditor.py", line 470, in createEditor
    if not editor.setup_and_check(value, title=key, readonly=readonly):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 660, in setup_and_check
    readonly, xlabels, ylabels))
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 541, in __init__
    ylabels=ylabels, readonly=readonly, parent=self)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 131, in __init__
    self.test_array = np.array([0], dtype=data.dtype)
ValueError: Converting an integer to a NumPy datetime requires a specified unit

Package Versions

  • Spyder version: 3.2.8
  • Python version: 3.6.5
  • Qt version: 5.9.4
  • PyQt5 version: 5.9.2
  • Operating system: Windows 10

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.4.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.23.0 (OK)
numpy >=1.7      :  1.14.3 (OK)
sphinx >=0.6.6   :  1.7.4 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.12.0 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.28.2 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.4.0 (OK)
pylint >=0.25    :  1.8.4 (OK)
Variable Explorer Bug

Most helpful comment

Thanks for referring me to #8582. I already updated everything but nothing worked out. Just had to downgrade my numpy version to 1.15.0. It may be useful for someone else in the future.

All 9 comments

I think it's not possible for Spyder to show an array in this case. So need to show a message about it.

Is this problem resolved? I am also facing the same issue. When I try to open an array the spyder shows the error that it has some internal issue. Could you please guide how to resolve it?

Same problem here ... everything is up to date.. Is someone working on this problem ???

Giving a some code to reproduce the error would help.

spyder error
My code runs fine but when I try to open array such as img_norm variable in this case, it shows this error and I can't see the values without printing the whole array.

@lalita90 What does it say in show details?

spyder error

@lalita90 You don't have this bug. You have #8582, which is fixed in 3.3.3. To fix it please upgrade to the latest version of Spyder by opening the Anaconda Prompt and typing:

conda update spyder

Thanks for referring me to #8582. I already updated everything but nothing worked out. Just had to downgrade my numpy version to 1.15.0. It may be useful for someone else in the future.

Was this page helpful?
0 / 5 - 0 ratings