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 no longer runs "windowless" on Windows 10/11 from virtual environment #23342

Closed
8 tasks done
DStauffman opened this issue Dec 24, 2024 · 4 comments
Closed
8 tasks done

Comments

@DStauffman
Copy link
Contributor

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [N/A] Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • [N/A] Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When I launch Spyder, I now get three blank windows that open up and stay open. It happens on both Windows 10 and Windows 11. I don't remember it happening when v6.0.0 came out, but maybe it did. I know it has happened in both v6.0.2 and v6.0.3

What steps reproduce the problem?

This is the same way I've been running spyder for several months now, because I really don't like the extra windows:

I install spyder within a virtual environment using pip, currently with Python v3.13.0

py -3.13 -m venv --upgrade-deps spyder
call .\spyder\Scripts\activate.bat
python -m pip install pip wheel
python -m pip install spyder ipykernel jupyterlab notebook numpy pandas
python -m pip install h5py tblib

I create a Windows spyder.bat file to run Spyder:

@echo off
cmd /k "cd /d C:\Users\USERNAME\Documents\venvs\spyder\Scripts & spyder.exe"

I create a Visual Basic wrapper, called run_spyder.vbs to run the bat file without keeping a window open:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Users\USERNAME\Documents\WinScripts\spyder.bat" & Chr(34), 0
Set WshShell = Nothing

Finally, I create a shortcut on my desktop that links to the vbs file and run that.

What is the expected output? What do you see instead?

I expect Spyder to run without any terminal windows that stay opened. Instead, I now see three of them. The first has a window title of "spyder.exe", while the second two appear to be instances of "pythonw.exe"

Versions

  • Spyder version: 6.0.3
  • Python version: 3.13.0
  • Qt version: 5.15.2
  • PyQt version: 5.15.11
  • Operating System name/version: Windows 10

The same thing happens on my Laptop that is running Windows 11.

Dependencies

# Mandatory:
aiohttp >=3.9.3                  :  3.11.8 (OK)
asyncssh >=2.14.0,<3.0.0         :  2.18.0 (OK)
atomicwrites >=1.2.0             :  1.4.1 (OK)
chardet >=2.0.0                  :  5.2.0 (OK)
cloudpickle >=0.5.0              :  3.1.0 (OK)
cookiecutter >=1.6.0             :  2.6.0 (OK)
diff_match_patch >=20181111      :  20241021 (OK)
github >=2.3.0                   :  2.5.0 (OK)
importlib_metadata >=4.6.0       :  8.5.0 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.30.0 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.2 (OK)
jellyfish >=0.7                  :  1.1.0 (OK)
jsonschema >=3.2.0               :  4.23.0 (OK)
keyring >=17.0.0                 :  25.5.0 (OK)
nbconvert >=4.0                  :  7.16.4 (OK)
numpydoc >=0.6.0                 :  1.8.0 (OK)
parso >=0.7.0,<0.9.0             :  0.8.4 (OK)
pexpect >=4.4.0                  :  4.9.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  6.1.0 (OK)
pygments >=2.0                   :  2.18.0 (OK)
pylint >=3.1,<4                  :  3.3.1 (OK)
pylint_venv >=3.0.2              :  3.0.4 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.12.0,<1.13.0           :  1.12.0 (OK)
pylsp_black >=2.0.0,<3.0.0       :  2.0.0 (OK)
pyuca >=1.2                      :  1.2 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.4 (OK)
qtawesome >=1.3.1,<1.4.0         :  1.3.1 (OK)
qtconsole >=5.6.1,<5.7.0         :  5.6.1 (OK)
qtpy >=2.4.0                     :  2.4.2 (OK)
rtree >=0.9.7                    :  1.3.0 (OK)
setuptools >=49.6.0              :  75.6.0 (OK)
sphinx >=0.6.6                   :  8.1.3 (OK)
spyder_kernels >=3.0.2,<3.1.0    :  3.0.2 (OK)
superqt >=0.6.2,<1.0.0           :  0.6.7 (OK)
textdistance >=4.2.0             :  4.6.2 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  6.0.0 (OK)
yarl >=1.9.4                     :  1.18.0 (OK)
zmq >=24.0.0                     :  26.2.0 (OK)

# Optional:
cython >=0.21                    :  None (NOK)
matplotlib >=3.0.0               :  None (NOK)
numpy >=1.7                      :  2.2.0 (OK)
pandas >=1.1.1                   :  2.2.3 (OK)
scipy >=0.17.0                   :  None (NOK)
sympy >=0.7.3                    :  None (NOK)

@ccordoba12
Copy link
Member

Hey @DStauffman, thanks for reporting. You said:

I create a Windows spyder.bat file to run Spyder
I create a Visual Basic wrapper, called run_spyder.vbs to run the bat file without keeping a window open

Unfortunately, we're a very small team and don't have the resources to support custom ways to launch Spyder. In other words, you're basically asking us to debug your own method to do that, for which we don't have time.

I expect Spyder to run without any terminal windows that stay opened

Spyder starts without terminal windows when using our own installers or Anaconda/Miniconda. So, I'm sorry to say it but it's up to you to solve this one, sorry,

If you find the cause, that cause is in Spyder and you'd like to submit a pull request to fix it, we'll be happy to merge it.

@ccordoba12 ccordoba12 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2024
@DStauffman
Copy link
Contributor Author

I looked into this a little bit, but couldn't find the problem. It seems very related to #4992. It is likely there is a call to subprocess.Popen somewhere that doesn't have the appropriate Windows flags being set.

@ccordoba12
Copy link
Member

I doubt that's the issue because other Windows users would be seeing this problem, and no one has reported it in a long time.

So, I think it lies in the way you're launching Spyder.

@DStauffman
Copy link
Contributor Author

Well, good news, this bug is fixed (in venv). I tried to better isolate when the problem happens and when it doesn't and I actually tied to my Python version (v3.13.0). I went back to Python v3.12.8 and everything behaves as expected, and then tried v3.13.1 and everything is once again as expected. I tracked it down to this bug (python/cpython#126084) in venv itself, which is what I was using to build the virtual environment.

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

No branches or pull requests

2 participants