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

Spyder 3 opens a command prompt window when running certain commands #3529

Closed
michaelklachko opened this issue Oct 12, 2016 · 7 comments
Closed

Comments

@michaelklachko
Copy link

I updated to Spyder 3, and now every time I click Run to launch my theano code, it will open nvcc.exe in a separate Windows command prompt window. Nothing else has changed.

What steps will reproduce the problem?

  1. Run some code that uses nvcc.exe (or probably any other compiler) in Spyder 2
  2. Update to Spyder 3
  3. repeating step 1 (exactly the same code) will cause a black command prompt windows to appear (launch of compiler.exe)

What is the expected output? What do you see instead?
I expect to see no external applications opened in separate command prompt windows

Versions and main components

  • Spyder Version: 3.0.0
  • Python Version: 2.7.11
  • Operating system: Windows 10 Anniversary Edition
  • Cuda 7.5
  • Theano 0.9 dev2

Dependencies

jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0 : 1.5.1 (OK)
nbconvert >=4.0 : 4.1.0 (OK)
numpy >=1.7 : 1.11.1 (OK)
pandas >=0.13.1 : 0.17.0 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.5.0 : 1.0.0 (OK)
pygments >=2.0 : 2.1.1 (OK)
pylint >=0.25 : 1.5.4 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.9.4 (OK)
sphinx >=0.6.6 : 1.3.5 (OK)
sympy >=0.7.3 : 0.7.6.1 (OK)

@ccordoba12 ccordoba12 added this to the wishlist milestone Oct 12, 2016
@ccordoba12
Copy link
Member

We changed how we embed IPython consoles in Spyder 3.0 and this seems to be a byproduct of that.

Since this is a minor (although annoying) issue, I don't think we're going to work on it for now :-)

@skjerns
Copy link
Contributor

skjerns commented Mar 8, 2017

A not-so-nice workaround is running this script in the background

import win32gui
import win32com.client
import time
prev_hwnd = win32gui.GetForegroundWindow()
while True:
    firefox = []
    toplist = []
    winlist = []
    hwnd = win32gui.GetForegroundWindow()
    title =  win32gui.GetWindowText(hwnd)
    if 'nvcc.exe' in title.lower():
        shell = win32com.client.Dispatch("WScript.Shell")
        shell.SendKeys('%')
        win32gui.SetForegroundWindow(prev_hwnd)
        print('Minimized nvcc.exe')
    else:
        prev_hwnd = hwnd

    time.sleep(0.001)

takes <1% of CPU and ~6 MB of memory on my machine.

@ccordoba12 ccordoba12 modified the milestones: v3.3, wishlist Mar 8, 2017
@nbmki1
Copy link

nbmki1 commented Aug 1, 2017

I am experiencing the same issue, although for another application: I run, say 1000-2000, optimizations in a for loop using a solver (cplex or gurobi) which makes an external command promt to pop up, and shut down, for each loop.

This results in each loop solving much slower than previously (without those pop ups). I have not calculate the difference, but in total we're in the range of 1-3s times 1000-2000 loops.

Moreover, if you e.g. write in a document with this problem running in the background, you get interrupted every 5'ish second.. Both issues - quite annoying :-)

@ccordoba12
Copy link
Member

If subprocess is used to run processes in the background, we could patch it to make it avoid opening new cmd windows.

@ccordoba12 ccordoba12 changed the title Spyder 3 opens compiler in a command prompt window Spyder 3 opens a command prompt window when running certain commands Aug 17, 2017
@ccordoba12 ccordoba12 modified the milestones: v3.2.2, v3.2.3 Aug 17, 2017
@rachel-elas-ai
Copy link

The part that goes beyond annoying is that the command prompt stays open (even after Spyder closes), but if you close the command prompt while Spyder is running, it crashes Spyder too, possibly losing your code.

@sama2689
Copy link

I am experiencing this now on Spyder 5 as well

@Anurag-Varma
Copy link

I am experiencing this now on Spyder 5 as well

same error after reinstalling the anaconda and used previous environment libraries

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

No branches or pull requests

7 participants