Spyder doesn't launch: stuck on “Setting up main window”
See original GitHub issueIssue 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
(orpip
, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole
(if console-related) - Tried basic troubleshooting (if a bug/error)
- Restarted Spyder
- Reset preferences with
spyder --reset
- 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 try to run Spyder on Ubuntu 16.10, it doesn’t launch and gets stuck on “Setting up main window” forever. No error messages are shown and it doesn’t crash.
When I try to run it from the source, the very same thing happens, and I get the message
Revision 03c7161, Branch: master
- Patched sys.path with /home/user/spyder/spyder
- PyQt5 is detected, selecting
- Imported Spyder 4.0.0.dev0 [Python 3.5.2 64bits, Qt 5.9.3, PyQt5 5.9.2 on Linux]
- Running Spyder Bootstrap completed in 00:00:00.5483
I tryied to debug the code and found that it doesn’t get past the line (which is in the file spyder/app/mainwindow.py)
self.console = Console(self, namespace, exitfunc=self.closing,
profile=self.profile,
multithreaded=self.multithreaded,
message=_("Spyder Internal Console\n\n"
"This console is used to report application\n"
"internal errors and to inspect Spyder\n"
"internals with the following commands:\n"
" spy.app, spy.window, dir(spy)\n\n"
"Please don't use it to run your code\n\n"))
Going deeper, it doesn’t go past the line sys.stdout = self.stdout_write
at def redirect_stds(self)
in spyder/interpreter.py.
What steps reproduce the problem?
- Try to run Spyder 3 or 4.
What is the expected output? What do you see instead?
Spyder should launch. Instead, it gets stuck on “Setting up main window” forever. Spyder 2 runs just fine.
Paste Traceback/Error Below (if applicable)
File "/home/user/spyder/spyder/spyder/app/mainwindow.py", line 3241, in main mainwindow = run_spyder(app, options, args) File "/home/user/spyder/spyder/spyder/app/mainwindow.py", line 3111, in run_spyder main.setup() File "/home/user/spyder/spyder/spyder/app/mainwindow.py", line 1175, in setup self.setup_layout(default=False) File "/home/user/spyder/spyder/spyder/app/mainwindow.py", line 1465, in setup_layout self.setup_default_layouts('default', settings) File "/home/user/spyder/spyder/spyder/app/mainwindow.py", line 1641, in setup_default_layouts widget.toggle_view(True) File "/home/user/spyder/spyder/spyder/plugins/ipythonconsole.py", line 760, in toggle_view self.create_new_client(give_focus=False) File "/home/user/spyder/spyder/spyder/plugins/ipythonconsole.py", line 1082, in create_new_client self.connect_client_to_kernel(client, is_cython=is_cython) File "/home/user/spyder/spyder/spyder/plugins/ipythonconsole.py", line 1120, in connect_client_to_kernel kc.start_channels(shell=True, iopub=True) File "/usr/local/lib/python3.5/dist-packages/qtconsole/kernel_mixins.py", line 43, in start_channels super(QtKernelClientMixin, self).start_channels(*args, **kw) File "/usr/local/lib/python3.5/dist-packages/jupyter_client/threaded.py", line 235, in start_channels self.ioloop_thread.start() File "/usr/local/lib/python3.5/dist-packages/jupyter_client/threaded.py", line 174, in start self._start_event.wait() File "/usr/lib/python3.5/threading.py", line 549, in wait signaled = self._cond.wait(timeout) File "/usr/lib/python3.5/threading.py", line 293, in wait waiter.acquire() KeyboardInterrupt
## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->
* Spyder version: 3 and 4
* Python version: 3.5
* Qt version: 5.9.3
* PyQt version: 5.9.2
* Operating System name/version: Ubuntu 16.04
### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->
PASTE DEPENDENCIES HERE
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Solved: Python editing and debugging does not work
Launch Spyder from the text command window by typing python.ide. undefined ... but doesn't get past the "Setting up main window.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I installed with PIP and I figured out the issue only happens with Python 3.8. I’ve tested on Python 3.7.5 and all works finely!
Exactly! This workaround did the trick for me:
%YOUR_PYTHON_ENV_DIR%\Lib\site-packages\tornado\platform\asyncio.py
where%YOUR_PYTHON_ENV_DIR%
may be your Python3, Anaconda, Miniconda, env directory etc.if typing.TYPE_CHECKING:
(immediately below the imports):Now Spyder 4.1.2 runs fine with Python 3.8 😃