Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid showing autoreload warnings #6297

Closed
csabella opened this issue Jan 25, 2018 · 4 comments
Closed

Avoid showing autoreload warnings #6297

csabella opened this issue Jan 25, 2018 · 4 comments
Labels
Milestone

Comments

@csabella
Copy link
Contributor

Description of your problem

Ran code and got this error in the console, not in the Internal Console or in the terminal, but directly after my printed output.

What steps will reproduce the problem?
Not sure. I ran this code from the editor. It probably sat for a few hours and then I ran it again. When I ran it the second time, it produced the output and then printed the error in the IPython console window.

with open(file, newline='') as csvfile:
    reader = csv.DictReader(csvfile)
    open_items = [row['id'] for row in reader]
    for i in range(10): 
        print(random.choice(open_items))

What is the expected output? What do you see instead?
I just expected to see my output and not a traceback. If I click run again, I don't get the error. I'll try to let it sit for awhile to see if that's the difference.

Please provide any additional information below
[autoreload of spyder.widgets.variableexplorer.utils failed: Traceback (most recent call last):
File "/home/cheryl/anaconda3/envs/spyder-dev/lib/python3.6/site-packages/IPython/extensions/autoreload.py", line 246, in check
superreload(m, reload, self.old_objects)
File "/home/cheryl/anaconda3/envs/spyder-dev/lib/python3.6/site-packages/IPython/extensions/autoreload.py", line 369, in superreload
module = reload(module)
File "/home/cheryl/anaconda3/envs/spyder-dev/lib/python3.6/imp.py", line 315, in reload
return importlib.reload(module)
File "/home/cheryl/anaconda3/envs/spyder-dev/lib/python3.6/importlib/init.py", line 166, in reload
_bootstrap._exec(spec, module)
File "", line 618, in _exec
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/cheryl/spyder/spyder/widgets/variableexplorer/utils.py", line 33, in
required_version=PANDAS_REQVER, optional=True)
File "/home/cheryl/spyder/spyder/dependencies.py", line 73, in add
% modname)
ValueError: Dependency has already been registered: pandas
]

Versions and main components

  • Spyder Version: 4.0.0.dev0 (up to date)
  • Python Version: 3.6.4
  • Qt Version: 5.6.2
  • PyQt Version: 5.6 on Linux
  • Operating system: Ubuntu 16.04

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
IPython >=4.0 : 6.1.0 (OK)
cython >=0.21 : 0.26.1 (OK)
jedi >=0.9.0 : 0.11.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
psutil >=0.3 : 5.4.1 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.3 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

@csabella
Copy link
Contributor Author

csabella commented Jan 25, 2018

I know this is a duplicate of #4940, but this is happening on the latest version.

@ccordoba12 ccordoba12 added this to the v3.2.8 milestone Jan 25, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.2.8, v3.2.9 Mar 3, 2018
@ccordoba12 ccordoba12 changed the title ValueError: Dependency has already been registered: pandas Avoid showing autoreload warnings Jun 3, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.3, v3.3.1 Jun 3, 2018
@CAM-Gerlach
Copy link
Member

I experienced this as well with a clean/untouched console that had been left open from the previous day, after importing a few data columns from the clipboard (testing #7244 ) as pandas dataframes, and then running (as my first actual command in the terminal) just test = [1, 2, 3, 4, 5] without ever having directly loaded or called pandas. This seems very similar to the original report, which involved reading in a csv and a substantial delay between the console being opened and the followup code.

Unfortunately, I opened a new console in the same spyder instance, repeated the steps (aside from the delay), but did not get the same error. Therefore, either the delay was in fact significant, the error occurring is non-deterministic, or there was something seemingly very small that I did differently that didn't trigger it.

@ccordoba12
Copy link
Member

It probably happens when you edit and import a file in the console which contains import pandas. It's a very minimal thing but we can't solve it in our side but in IPython.

@CAM-Gerlach
Copy link
Member

Hmm, well for me it happened in a clean console I'd opened the day before and never touched. It happened the on the very first command I entered, just creating a vanilla python list. The only thing I'd done was use the import from clipboard dialog to create a dataframe (which, however, would of course use pandas). But it didn't happen again when I tried the exact same thing in another fresh console, just not waiting a day to use it. So strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants