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 not working w/ WinPython-64bit-3.6.3.0Qt5 #582

Closed
captaindet opened this issue Dec 12, 2017 · 33 comments
Closed

spyder not working w/ WinPython-64bit-3.6.3.0Qt5 #582

captaindet opened this issue Dec 12, 2017 · 33 comments

Comments

@captaindet
Copy link

hi,

the subject is not quite right, after a nasty tweak i got it working (somewhat), please bear with me.

note my system is Win7-64 and i want to use the latest python 3.6 and spyder/qt5. i know what you have said elsewhere about this combination ... however, all WinPython3/qt distros of the last 1.5 years have worked for me without problems, incl WinPython-64bit-3.6.2.0Qt5. mind you: i have never registered WinPython with the OS and i usually (have to) delete the previous .[enter-settings-dir-here]. (there are sometimes quirks with the firewall that need to be sorted out though.)

now i tried to migrate to WinPython-64bit-3.6.3.0Qt5, but spyder just won't start. this is the traceback from the error log (cf issue #579):

Traceback (most recent call last):
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\app\mainwindow.py", line 3099, in main
    mainwindow = run_spyder(app, options, args)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\app\mainwindow.py", line 3001, in run_spyder
    main.setup()
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\app\mainwindow.py", line 1171, in setup
    self.setup_layout(default=False)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\app\mainwindow.py", line 1437, in setup_layout
    self.setup_default_layouts('default', settings)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\app\mainwindow.py", line 1614, in setup_default_layouts
    widget.toggle_view(True)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\plugins\ipythonconsole.py", line 713, in toggle_view
    self.create_new_client(give_focus=False)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1009, in create_new_client
    self.connect_client_to_kernel(client)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1035, in connect_client_to_kernel
    stderr_file)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1440, in create_kernel_manager_and_kernel_client
    kernel_manager.start_kernel(stderr=stderr)
  File "B:\P\python-3.6.3.amd64\lib\site-packages\jupyter_client\manager.py", line 234, in start_kernel
    "Currently valid addresses are: %s" % local_ips()
RuntimeError: Can only launch a kernel on a local interface. Make sure that the '*_address' attributes are configured properly. Currently valid addresses are: ['130.216.54.47', '0.0.0.0', '']

the usual tricks of deleting (all) the .settings dirs and running spyder_reset did not help.

the code eventually failing seems to be jupyter_client\manager.py, line ~234

        if self.transport == 'tcp' and not is_local_ip(self.ip):
            raise RuntimeError("Can only launch a kernel on a local interface. "
                               "Make sure that the '*_address' attributes are "
                               "configured properly. "
                               "Currently valid addresses are: %s" % local_ips()
                               )

i realize that this test was present in older releases as well, yet, something triggers it to fail in the latest release.

now the remedy: if i comment this test out, spyder starts up normally, my code works, my plots plot - hurray!

obviously, this is not an ideal solution and i hope that you might be able to track down what the root problem is.

finally, while most is running fine after this tweak, i run into one issue which i cannot tell if it is related to my tweak, the root problem, or some unrelated spyder bug: i don't like inline graphics so i set IPython_console/Graphics/Backend to Automatic or Qt5. When doing so, restarting the kernel in an IPython console triggers a runtime error:

 Traceback (most recent call last):

  File "<ipython-input-1-64557277dbff>", line 1, in <module>
    get_ipython().run_line_magic('matplotlib', 'qt5')

  File "B:\P\python-3\lib\site-packages\IPython\core\interactiveshell.py", line 2095, in run_line_magic
    result = fn(*args,**kwargs)

  File "<decorator-gen-108>", line 2, in matplotlib

  File "B:\P\python-3\lib\site-packages\IPython\core\magic.py", line 187, in <lambda>
    call = lambda f, *a, **k: f(*a, **k)

  File "B:\P\python-3\lib\site-packages\IPython\core\magics\pylab.py", line 99, in matplotlib
    gui, backend = self.shell.enable_matplotlib(args.gui)

  File "B:\P\python-3\lib\site-packages\IPython\core\interactiveshell.py", line 2983, in enable_matplotlib
    self.enable_gui(gui)

  File "B:\P\python-3\lib\site-packages\ipykernel\zmqshell.py", line 482, in enable_gui
    real_enable_gui(gui)

  File "B:\P\python-3\lib\site-packages\ipykernel\eventloops.py", line 308, in enable_gui
    raise RuntimeError("Cannot activate multiple GUI eventloops")

RuntimeError: Cannot activate multiple GUI eventloops
@stonebig
Copy link
Contributor

that smells like a TCP-IP problem, maybe related to your firewall, maybe related to spyder, maybe related to ipython.

Does the qtconsole standalone application works flawlessly ? and Jupyter Notebok ?

If only spyder seems the problem, you can downgrade spyder, or upgrade it as a try.

@stonebig
Copy link
Contributor

stonebig commented Dec 12, 2017

ah, someone else has the issue on the 3.5 version: spyder-ide/spyder#5969

so good news: you're not alone, maybe there is an answer on stackoverflow. or it's your colleague next door

@captaindet
Copy link
Author

thanks for looking into this. here some more testing results:

that smells like a TCP-IP problem, maybe related to your firewall, maybe related to spyder, maybe related to ipython.

same problem w/ firewall disabled

Does the qtconsole standalone application works flawlessly ? and Jupyter Notebok ?

both work fine

If only spyder seems the problem, you can downgrade spyder, or upgrade it as a try.

negative, won't work with spyder 3.2.3. haven't tried versions older than that though. HOWEVER, i did test WinPython-64bit-3.6.2.0Qt5 and upgraded spyder to 3.2.4 - it starts up and works fine with the older WinPython release! also, the other problem about the RuntimeError when restarting the kernel in non-inline graphics mode does NOT occur.

therefore it does not seem to be a problem with spyder itself

@stonebig
Copy link
Contributor

hum, so I have no real clue looking at the changelog https://github.com/winpython/winpython/blob/master/changelogs/WinPythonQt5-32bit-3.6.3.0_History.md,

It could be new compiled modules became incompatible with windows7, and so next updates won't work either.

@captaindet
Copy link
Author

i was just about to crawl through the module updates to see where/when it fails - however seeing and following CAM-Gerlach reference lead me to
#spyder-ide/spyder#5101
and this response from the spyder team:

ccordoba12 commented on Sep 1

It seems localhost is not available in your PC as an address to connect to. However, this is not a Spyder problem, please report it here:

https://github.com/winpython/winpython/

now the question is why is localhost available in the previous release WinPython-64bit-3.6.2.0Qt5 and earlier, but not in the current release WinPython-64bit-3.6.3.0Qt5.exe?

@captaindet
Copy link
Author

here is a new lead:

using a freshly 'installed' (just unpacked) previous release WinPython-64bit-3.6.2.0Qt5 - which works fine incl spyder - and then uninstalling spyder_terminal produces the same 'local interface' problem as seen in WinPython-64bit-3.6.3.0Qt5, where spyder_terminal has not been packaged in the first place!

also strange: re-installing spyder_terminal silently fails on both distros, WinPython-64bit-3.6.2.0Qt5 and WinPython-64bit-3.6.3.0Qt5 (tried spyder-terminal-0.2.2.zip and spyder-terminal-0.2.3.zip).

@stonebig
Copy link
Contributor

interesting

@captaindet
Copy link
Author

well, it seems like an packaging issue to me. are you still following up on this one or shall i rather file 2 new issues,

"WinPython-64bit-3.6.2.0Qt5 does not start after uninstalling spyder_terminal"

and

"WinPython-64bit-3.6.2.0Qt5 and WinPython-64bit-3.6.3.0Qt5: cannot install spyder_terminal"

?

@stonebig
Copy link
Contributor

stonebig commented Dec 21, 2017

I'll re-add spyder-terminal in next release, that's all I can do

@hiccup7
Copy link

hiccup7 commented Dec 23, 2017

I see the same problem as @captaindet with WinPython-64bit-3.6.3.0Qt5 on my Win7 PC. I can work around the problem by deleting all of Spyder's data and rerunning Spyder with the internet disconnected! But the problem returns when I run Spyder with the internet connected.

Using my firewall, I allow pythonw.exe to connect to localhost (127.0.0.1), but block all connections to the internet. In my firewall logs, I see attempts to connect to 104.24.18.65, 104.24.19.65 and 74.125.196.94. A reverse-DNS search on the first two has no results, but the last result is "yk-in-f94.1e100.net" When I go to this site in my web browser, I see Google's logo and a 404 error. Thus, my diagnosis is that Spyder crashes if the PC is connected to the internet and connections to Google are blocked or time out.

Since @captaindet reports that Spyder 3.2.4 works in WinPython-64bit-3.6.2.0Qt5, it may not be Spyder that is connecting to Google but some other package in WinPython-64bit-3.6.3.0Qt5. I think the solution is to not re-add spyder-terminal in next release, but instead remove the package(s) connecting to the internet.

@stonebig
Copy link
Contributor

stonebig commented Dec 24, 2017

on 1e100.net, there is this:
https://support.google.com/faqs/answer/174717?hl=en

@hiccup7
Copy link

hiccup7 commented Jan 4, 2018

I believe the problem seen by @captaindet when setting IPython_console/Graphics/Backend to Automatic or Qt5 was fixed by spyder-ide/spyder#6091

On my Win7 PC, I tested WinPython-64bit-3.6.4.0Qt5b2, which has spyder-3.2.6dev20171230+ and spyder_terminal v0.2.3 installed. With the internet connected, my firewall logs show no attempts by pythonw.exe to connect to the internet. However, I get a pop-up error window saying that "Qt QtWebEngineProcess.exe has stopped working". Task Manager shows that this process is a cmd.exe shell spawned by the spyder_terminal package.

I reverted Spyder to v3.2.4 to fix the Qt5 backend problem, but QtWebEngineProcess.exe crash problem continues when the internet is connected. The crash does not seem to occur when the internet is disconnected when Spyder starts up.

Has any other WinPython user seen this bug in spyder_terminal v0.2.3? The Spyder team seems to want problems reproduced in the Anaconda distribution as a first step. Since their projects are no longer funded by Anaconda Inc., I can understand that time spent by them is greatly reduced if they don't have to debug WinPython-unique configuration issues. Since I mostly work with the internet disconnected on my PC where I use Python, this bug does not really affect me, and I don't have time now to pursue it further. Anyone willing to reproduce this bug in Anaconda would be doing a good service to the Python community.

cc: @ccordoba12

@stonebig
Copy link
Contributor

stonebig commented Jan 4, 2018

so:

@hiccup7
Copy link

hiccup7 commented Jan 4, 2018

Is the problem "RuntimeError: Can only launch a kernel on a local interface" only observed on Win7 PCs? My Win7 PC is the only one I have connected to the internet.

I would like faster startup and shutdown of Spyder, so I prefer to remove the spyder_terminal package. However, does the Spyder team test without spyder_terminal in the Anaconda environment? If not, removing spyder_terminal would make WinPython different than Anaconda, and WinPython users could then experience problems and get no help from the Spyder team.

Under Spyder > Help > Dependencies..., spyder_terminal is not listed. But is spyder_terminal included in the dependencies of the Spyder conda package?

@hiccup7
Copy link

hiccup7 commented Jan 5, 2018

For WinPython-64bit-3.6.4.0Qt5b3, how about removing the WinPython-specific "opengl32sw.dll"? I will test on my Win7 PC. Another incentive to test beta 3 is to get a fix for spyder-ide/spyder#6091

If users uninstall spyder_terminal, but then want to install it again, do you download the wheel from here? https://pypi.python.org/pypi/spyder-terminal/0.2.3

@stonebig
Copy link
Contributor

stonebig commented Jan 5, 2018

@hiccup7 yes, yes

@stonebig
Copy link
Contributor

stonebig commented Jan 6, 2018

hi @hiccup7 , did the use of latest spyder from https://github.com/winpython/winpython_afterdoc/tree/master/various_wheels improved the situation ?

@stonebig
Copy link
Contributor

stonebig commented Jan 6, 2018

this is also a duplicate of this one #577

I have no clue on this, my best wild guess is there is a timeout somewhere.

@stonebig
Copy link
Contributor

stonebig commented Jan 6, 2018

will ship a modified jupyter_client wheel in next build , so the error message may be more self-explaining.

@hiccup7
Copy link

hiccup7 commented Jan 13, 2018

I installed cgohlke's wheel for Spyder v3.2.6 into WinPython-64bit-3.6.4.0Qt5b2 (including spyder_terminal v0.2.3) on my Win7 PC. I deleted all Spyder data, connected the internet and ran Spyder. No failures. My firewall logs show no attempts by pythonw.exe to connect to the internet. I set the IPython graphics backend to Qt5, enabled automatic load of Pylab and NumPy modules and restarted Spyder. No failures!

I uninstalled spyder_terminal v0.2.3 using the WinPython Control Panel, deleted all Spyder data, connected the internet and ran Spyder. No failures. I set the IPython graphics backend to Qt5, enabled automatic load of Pylab and NumPy modules and restarted Spyder. No failures! Without spyder_terminal, I observed two fewer processes used by Spyder and faster startup and termination.

I reinstalled spyder_terminal v0.2.3 (from https://pypi.python.org/pypi/spyder-terminal/0.2.3) using the WinPython Control Panel, deleted all Spyder data, connected the internet and ran Spyder. No failures. I set the IPython graphics backend to Qt5, enabled automatic load of Pylab and NumPy modules and restarted Spyder. No failures! Therefore, WinPython Control Panel has no problem installing spyder_terminal on my PC.

In conclusion, Spyder v3.2.6 solved all the problems in this issue on my Win7 PC. Also, I recommend removing spyder_terminal from the next WinPython build for faster Spyder startup and termination.

cc: @ccordoba12 @CAM-Gerlach

@stonebig
Copy link
Contributor

thanks for the testing effort @hiccup7. following your advice, I remove again spyder-terminal for the moment

@Rhinou
Copy link

Rhinou commented Jan 18, 2018

I have run into this very same problem after switching from WinPython 2.x to 3.x. Having still installed both, I can confirm everything works as expected with the latest 2.x stable version (2.7.10.3), but moving to 3.x caused some problems.

First, the latest one 64bit-3.6.3.0Qt5 does not work at all. I click on Spyder, and nothing happens. It is only when I start task-manager that I see python is running in the background, but no Spyder interface is shown. I downgraded one step to 64bit-3.6.2.0Qt5. Now I can start Spyder, but I discovered two new bugs:

  1. I can not switch to some of pre-defined layouts (View -> Windows Layout). No matter what I select (Spyder, Matlab, Rstudio), layout stays always the same. Even Alt+Shift+PgUp/PgDown does not work.

  2. On-line help does not work. When I activate it (View -> Panes -> OnLine help), main windows shows correctly (Index of Modules, with list of built-in modules), but whenever I click on some module/function for help, all I see is "Unable to load page". So I had to downgrade again. To put it short:

3.6.3.0Qt5/64b: Spyder does not start at all
3.6.2.0Qt5/64b: Spyder starts, bud pre-defined layouts do not work, on-line help does not work
3.5.4.1Qt5/64b: Spyder starts, bud pre-defined layouts do not work, on-line help does not work
3.4.4.6Qt5/64b: Finally version that works!

So I decided to stay with 3.4.4.6 till these strange problems are solved...

@CAM-Gerlach
Copy link

CAM-Gerlach commented Jan 18, 2018

Sorry for the problems, @Rhinou , and thanks for reporting. We wish we could do more to help form the Spyder side, but due to our limited resources, particularly now that we are currently unfunded, we are only able to really provide support with installation-related issues with the Anaconda distribution, which which is currently working just fine and more up to date than WinPython with regard to the Spyder version. However, hopefully you and the WinPython folks are able to get it working from here.

I can not switch to some of pre-defined layouts (View -> Windows Layout). No matter what I select (Spyder, Matlab, Rstudio), layout stays always the same. Even Alt+Shift+PgUp/PgDown does not work.

IIRC this may be related to a Spyder bug fixed several releases ago; at least under Anaconda the layouts you've mentioned have worked just fine over the past several releases, as I've personally tested them on multiple occasions on Windows 8.1 and Windows 10.

Best of luck!

@Rhinou
Copy link

Rhinou commented Jan 22, 2018

I installed the latest Anaconda 5.0.1/64b and can confirm Spyder works as expected. Two above mentiones bugs (changing layout and on-line help) does not occur there. That is strange, because Anaconda 5.0.1 is using the same Spyder version (3.2.4) as the latest WinPython. It seems bug is not in Spyder, but in WinPython installer...

@hiccup7
Copy link

hiccup7 commented Jan 22, 2018

I tested WinPython-64bit-3.6.4.0Qt5b4, which includes Spyder v3.2.6, on my offline Windows 8.1 PC. No failures on the first run of Spyder. I set the IPython graphics backend to Qt5, enabled automatic load of Pylab and NumPy modules and restarted Spyder. No failures.

I tested WinPython-64bit-3.6.4.0Qt5b4 on my internet-connected Windows 7 PC. I configured my firewall to block pythonw.exe connections to the internet (it allows loopback connections to local host). No failures on the first run of Spyder. I set the IPython graphics backend to Qt5, enabled automatic load of Pylab and NumPy modules and restarted Spyder. No failures. My firewall logs show no attempts by pythonw.exe to connect to the internet.

I am happy with WinPython-64bit-3.6.4.0Qt5b4!

@hiccup7
Copy link

hiccup7 commented Jan 22, 2018

@Rhinou - The problem you saw with Spyder in WinPython may be due to the combinations of versions of IPython, Spyder and matplotlib. Spyder v3.2.6 contains a fix for spyder-ide/spyder#6091 so Spyder is now more robust against such problems.

It would be helpful to the WinPython community if you test with the latest WinPython beta, which contains Spyder v3.2.6. Or at least update old WinPython installations with the Spyder wheel from https://www.lfd.uci.edu/%7Egohlke/pythonlibs/ Otherwise, users who read this thread are left with the rumor you started about the WinPython installer being the cause of this problem.

See https://sourceforge.net/projects/winpython/files/WinPython_3.6/3.6.4.0/betas/

@CAM-Gerlach
Copy link

CAM-Gerlach commented Jan 23, 2018

@Rhinou

That is strange, because Anaconda 5.0.1 is using the same Spyder version (3.2.4) as the latest WinPython.

Make sure to update to the latest version of Spyder, 3.2.6, with conda update spyder, for a number of improvements and bug fixes.

It seems bug is not in Spyder, but in WinPython installer...

It could be, or in any number of variables related to your WinPython environment or the packages installed with it. No way for us to really know, without through testing or with one of the WinPython people looking into it.

I am happy with WinPython-64bit-3.6.4.0Qt5b4!

Fantastic; hope it keeps working for you.

@hiccup7

The problem you saw with Spyder in WinPython may be due to the combinations of versions of IPython, Spyder and matplotlib.

Its quite possible. If WinPython 3.6.3 picked different exact versions than Anaconda 5.0.1, and/or installed configured them differently, then there is certainly the potential, though one can still conceivably attribute that to the choices of the WinPython installer in some fashion, if not a explicit bug. No way to know without testing, which is a moot point now given it works in the latest builds of both WinPython and Anaconda.

Otherwise, users who read this thread are left with the rumor you started about the WinPython installer being the cause of this problem.

Something I've learned through experience is that throwing out accusatory statements isn't usually the best way to get a well intentioned user (as @Rhinou appears to be) to agree with you and change their statements. I certainly am no fan of jumping to conclusions on the cause of a certain problem (though am by no means immune), but while I assume you didn't mean to sound so harsh, implying @Rhinou is at fault for starting a negative rumor about the WinPython installer just by making the not unreasonable personal observation that it "seems" to be the source of the problem is a little extreme, and certainly not conducive to productively solving this problem. Therefore, if you wouldn't mind refraining from such statements, that would be much appreciated. Thanks.

@Rhinou
Copy link

Rhinou commented Jan 31, 2018

Tested the latest beta WinPython-64bit-3.6.4.0Qt5b4.exe: Spyder starts, bug with layout is gone. But bug with on-line help is still there:

Activate on-line help (View -> Panes -> Online help), select on-line help tab, click on any item (i.e. "math"), and result is:
"Unable to load page"...

@CAM-Gerlach
Copy link

CAM-Gerlach commented Jan 31, 2018

@Rhinou Thanks for the followup. Glad the one bug is gone. As for the other, I tested just now in Spyder 3.2.6 and Python 3.6.4 and I couldn't reproduce it, sorry. Could have something to do with your firewall or security software blocking the connection, with your Qt, or with whatever bindings allow Spyder to browse the web not working properly in your WinPython installation. While unfortunate, it may be fixable on your end but likely isn't on ours, even if we had the time, sorry.

@Rhinou
Copy link

Rhinou commented Jan 31, 2018

I doubt it could be caused by my configuration. As I wrote previously, much older version of WinPython 3.4.4.6Qt5/64b with Spyder 3.1.2 (which I have installed side-by-side with 3.6.4.0Qt5b4/64b, Spyder 3.2.6) works perfectly, without any bugs. I also tested Anaconda 5.0.1, with Spyder 3.2.4: it works without any problem too. I made these tests on 3 different computers, always with the same results...

I do not know about that firewall/security software, but I made no special settings for WinPython 3.4.4.6Qt5, nor for Anaconda 5.0.1, and Spyder there works. BTW, I'm not sure that "online help" is trully on-line, as I do not see any network-traffic. I thought that "online help" was saved somewhere locally during installation (maybe this changed between versions...

@CAM-Gerlach
Copy link

CAM-Gerlach commented Jan 31, 2018

@Rhinou Thanks for following up.

I doubt it could be caused by my configuration.

If not yours then WinPython's; as you stated, it works just fine on all the machines under Anaconda. Therefore, coupled with that fact that network access from the Qt API onward is completely outside of Spyder's control, it follows that this is a WinPython problem, and regardless it seems very unlikely that this is fixable in Spyder's codebase. Therefore, we again recommend that you simply just use Anaconda, which works just fine as you mentioned. Thanks.

I'm not sure that "online help" is trully on-line, as I do not see any network-traffic. I thought that "online help" was saved somewhere locally during installation (maybe this changed between versions...

It is, or it would not be called online help haha. I do see network traffic when I click a link, and when I pull out my network cable, it stops working...an easy way to test that, btw.

@hiccup7
Copy link

hiccup7 commented Feb 9, 2018

@stonebig - I recommend closing this issue. The Spyder bugs reported in the opening post by @captaindet (startup crash and crash when activating matplotlib Qt5 backend) have been fixed in Spyder v3.2.6. It is available in WinPython-64bit-3.6.4.0Qt5b4 and later.

9 users from the Spyder project have been referred to this WinPython issue so far, and it would be much clearer for them if this solved issue was closed with a clear resolution (which I stated above). Maybe some of those 9 issues are different than this one. Having one issue in each WinPython issue will also allow the Spyder team to be more specific when referring WinPython users.

@Rhinou - Thanks for reporting your testing results. If you want help from the community on the new issue about the bug with on-line help, I recommend opening a new WinPython issue. This will allow the community to document and find the conditions specific to this new issue. By the way, I also reproduced this issue on my 64-bit Win7 PC.

@stonebig
Copy link
Contributor

stonebig commented Feb 10, 2018

fixed in Spyder v3.2.6.

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

5 participants