These are chat archives for spyder-ide/public

21st
Feb 2019
jproy
@jproy
Feb 21 10:28
Hi, I'm on MacOS High Sierra. I finally got a stable config and this morning updated conda (ok and Python was updated from 3.7.1 to 3.7.2), then I tried to update spyder from 3.3.2 to 3.3.3 with conda update spyder and everything broke (I was about to say as usual on Mac) with the following :
The rest of the previous message :
jproy
@jproy
Feb 21 10:36
  added / updated specs:
    - spyder


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ipykernel-5.1.0            |py37h24bf2e0_1002         156 KB  conda-forge
    pyqt-5.6.0                 |py37hc26a216_1008         4.6 MB  conda-forge
    qt-5.6.2                   |       h9e3eb04_4        65.4 MB  conda-forge
    qtconsole-4.4.3            |             py_0          81 KB  conda-forge
    sip-4.18.1                 |py37h0a44026_1000         242 KB  conda-forge
    spyder-3.3.3               |           py37_0         2.4 MB  conda-forge
    spyder-kernels-0.4.2       |           py37_0          64 KB  conda-forge
    wurlitzer-1.0.2            |        py37_1000          11 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        72.9 MB

The following NEW packages will be INSTALLED:

  wurlitzer          conda-forge/osx-64::wurlitzer-1.0.2-py37_1000

The following packages will be UPDATED:

  ipykernel               pkgs/main::ipykernel-4.9.0-py37_1 --> conda-forge::ipykernel-5.1.0-py37h24bf2e0_1002
  qtconsole          pkgs/main/osx-64::qtconsole-4.4.1-py3~ --> conda-forge/noarch::qtconsole-4.4.3-py_0
  spyder                     pkgs/main::spyder-3.3.2-py37_0 --> conda-forge::spyder-3.3.3-py37_0
  spyder-kernels     pkgs/main::spyder-kernels-0.2.6-py37_0 --> conda-forge::spyder-kernels-0.4.2-py37_0

The following packages will be SUPERSEDED by a higher-priority channel:

  pyqt                 pkgs/main::pyqt-5.9.2-py37h655552a_2 --> conda-forge::pyqt-5.6.0-py37hc26a216_1008
  qt                         pkgs/main::qt-5.9.6-h45cd832_2 --> conda-forge::qt-5.6.2-h9e3eb04_4
  sip                  pkgs/main::sip-4.19.8-py37h0a44026_0 --> conda-forge::sip-4.18.1-py37h0a44026_1000

Then launching spyder& at the Terminal, I got the error :

(base) ~$ Traceback (most recent call last):
  File "/Users/roy/anaconda3/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/roy/anaconda3/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "/Users/roy/anaconda3/lib/python3.7/site-packages/spyder/app/start.py", line 186, in main
    from spyder.app import mainwindow
  File "/Users/roy/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 90, in <module>
    from qtpy import QtWebEngineWidgets  # analysis:ignore
  File "/Users/roy/anaconda3/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
    from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: dlopen(/Users/roy/anaconda3/lib/python3.7/site-packages/PyQt5/QtWebKitWidgets.so, 2): Library not loaded: @rpath/libQt5WebKitWidgets.5.dylib
  Referenced from: /Users/roy/anaconda3/lib/python3.7/site-packages/PyQt5/QtWebKitWidgets.so
  Reason: image not found

Please HELP :-)

CAM Gerlach
@CAM-Gerlach
Feb 21 15:30
@Rondesgr I'm not sure, but its probably expected behavior if you aren't familiar with Python, I'd guess. If the variables are in a scope below the current script/module, then Spyder won't see them. But I'm not sure about them appearing and disappearing, unless you're using del or the debugger. On what lines specifically do they disappear? Can you provide a GIF screenshot showing this behavior?
CAM Gerlach
@CAM-Gerlach
Feb 21 15:36
@jproy Although you didn't show the actual command you ran the produced that output, its clear why things broke—you can see from the output that many packages (most importantly PyQt and Qt) are being updated to conda-forge versions, while presumably the rest of your packages are on AD defaults. This is not (yet) supported by Anaconda, since the two stacks are not 100% binary compatible and particularly mixing the two when Qt is involved will almost certainly result in errors launching anything requiring it (like Spyder). This was caused by you either using the -c conda-forge option at some point when updating, or adding conda-forge to your channel list. Therefore, to resolve this, you should run conda list, find all the packages listed there that say conda-forge, and then do conda install -c defaults NAMES OF PACKAGES HERE. In the future, if you want to install stuff from conda-forge, you should create a separate isolated environment just for that so as to not contaminate your base one.
Best of luck!
Bruno Afonso
@bafonso
Feb 21 16:05
I am trying to use spyder to develop some python opencv code, is anyone doing this? I need it to be on a docker as I'd like to also use tensorflow...
@jproy I have ran into the same issue, it appears one needs to compile qt on ubuntu :/
How come spyder doesn't have a discourse or similar? seems much more efficient than a chat where things get asked numerous times
CAM Gerlach
@CAM-Gerlach
Feb 21 17:39

I am trying to use spyder to develop some python opencv code, is anyone doing this?

@bafonso A number of people are, yes; there have been many people on here who use it. It seems to be a little tricky to get installed/working, but it seems its perfectly doable.

I need it to be on a docker as I'd like to also use tensorflow...

If you are running your code in a Docker container, you should be able to connect to the kernel within Spyder running on your host OS and use it just like any other IPython Console tab, using the Connect to kernel dialog and the appropriate version of spyder-kernels running inside your Docker container.

I have ran into the same issue, it appears one needs to compile qt on ubuntu :/

As I explained in the comment right above yours, the issue is due to mixing conda-forge and defaults packages, which Anaconda does not support and will specifically lead to Qt problems. The solution is to simply not mix defaults and conda-forge packages in the same environment wherever possible.

How come spyder doesn't have a discourse or similar? seems much more efficient than a chat where things get asked numerous times

The chat is primarily intended for quick questions that aren't answered in our website, README, documentation, troubleshooting guide, wiki, or Stack Overflow (which can all be searched via Google). We have a Google Groups forum for people to ask more substantive questions and search previous replies. The problem with something like discourse is it costs $1200 a year, which is a huge chunk of our limited development budget since we're an entirely community-supported open-source project.

Bruno Afonso
@bafonso
Feb 21 21:18
Thanks for the replies @CAM-Gerlach , I ended up being able to run spyder fully on the docker but it's a bit of a nightmare, that said, it does work! I should share the Dockerfile and blog post about it. Running discourse is free if you have hosting, but I understand that requires a volunteer to run it and a way to make sure you have appropriate hosting.
The tricky part developing opencv using spyder is that more often than not you want to use cv2.imshow() instead of going through other ways to display images such as matplotlib (too slow for videos). This is why I don't believe connecting to kernels works.. or would the host OS spyder use the host opencv to display the Mat variable in the docker kernel ?
CAM Gerlach
@CAM-Gerlach
Feb 21 21:42

it's a bit of a nightmare, that said, it does work! I should share the Dockerfile and blog post about it.

I'd be happy to take a look at it, if you're able to share at some point. Perhaps we can identify any particular pain points with Spyder that we can fix on our end; we've got big plants for much-improved remote kernel features in Spyder 5 if that gets funded and relates to your problems.

a way to make sure you have appropriate hosting.

Unfortunately we host our site on Github Pages right now, so we'd need to pay for that and its one more outlet to maintain and monitor on top of Github, Gitter, SO, Google Groups, Facebook and Twitter...but we'll certainly keep it in mind and appreciate your suggestion.

more often than not you want to use cv2.imshow()

Does this command not work? Did you try changing the graphics backend?

would the host OS spyder use the host opencv to display the Mat variable in the docker kernel

For plotting, it should use the kernel (inside Docker's) opencv, just like for any other command, while for opening variables in the Variable Explorer it uses the host's. We are going to try to implement arbitrary object support for custom classes without requiring the host environment to have the package it comes from, and in a nicer viewer to boot, but we're not 100% sure if its possible.

Thanks for your feedback @bafonso !