question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when importing CSV file from Variable tab

See original GitHub issue

Description

What steps will reproduce the problem?

Importing CSV file from Variable tab will thow an error

Traceback

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 576, in _set_step
    self.text_widget.get_comments())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 478, in open_data
    skiprows, comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 411, in process_data
    comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 391, in _shape_text
    from numpy import nan
ImportError: cannot import name 'nan' from 'numpy' (unknown location)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 576, in _set_step
    self.text_widget.get_comments())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 478, in open_data
    skiprows, comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 411, in process_data
    comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 391, in _shape_text
    from numpy import nan
ImportError: cannot import name 'nan' from 'numpy' (unknown location)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 576, in _set_step
    self.text_widget.get_comments())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 478, in open_data
    skiprows, comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 411, in process_data
    comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 391, in _shape_text
    from numpy import nan
ImportError: cannot import name 'nan' from 'numpy' (unknown location)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 576, in _set_step
    self.text_widget.get_comments())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 478, in open_data
    skiprows, comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 411, in process_data
    comments)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\importwizard.py", line 391, in _shape_text
    from numpy import nan
ImportError: cannot import name 'nan' from 'numpy' (unknown location)

Versions

  • Spyder version: 4.0.1
  • Python version: 3.7.5
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies

atomicwrites >=1.2.0         :  1.3.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
cloudpickle >=0.5.0          :  1.2.2 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
IPython >=4.0                :  7.11.1 (OK)
jedi =0.14.1                 :  0.14.1 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
numpydoc >=0.6.0             :  0.9.2 (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
psutil >=0.3                 :  5.6.7 (OK)
pygments >=2.0               :  2.5.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.2 (OK)
zmq >=17                     :  18.1.0 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
sphinx >=0.6.6               :  2.3.1 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
watchdog                     :  None (OK)
cython >=0.21                :  None (NOK)
matplotlib >=2.0.0           :  None (NOK)
numpy >=1.7                  :  None (NOK)
pandas >=0.13.1              :  None (NOK)
scipy >=0.17.0               :  None (NOK)
sympy >=0.7.3                :  None (NOK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
goanpecacommented, Feb 23, 2020

The problem is we’re not creating a FakeObject to stand for array in case the import fails.

Correct

0reactions
yekhtiaricommented, Feb 23, 2020

@goanpeca Here you go: tree.zip image As you can see in the picture ,Next button is enabled,but clicking on it will error out.Also preview tab is disabled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Common CSV Import Errors and How to Fix Them - Flatfile
One of the most common CSV import errors is that the file is simply too large. That can be caused by too many...
Read more >
Common CSV Template Error Messages and How to Fix Them
To fix this error, the uploaded CSV file must be fixed so as to be a valid UTF-8 CSV file. You should check...
Read more >
Tackling the most common errors when trying to import a CSV
Review of the most common issues that arise during an import using CSV. ... Everyone who has imported data has run into import...
Read more >
Stata gives “too many variables specified” error ... - Statalist
I have datasets in csv format containing more than 1 million ... Stata gives “too many variables specified” error when importing csv file....
Read more >
Solved: proc import - unsuccessful - SAS Support Communities
I am not certain I understand this error message well. What caused the unsuccessful importing? (Log file begins). 1. 2 PROC IMPORT DATAFILE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found