Repository: spyder-ide/spyder

Issue:
Variable explorer broken because of DeprecationWarning in ipykernel
## Description of your problem
When I try to access anything in the variable explorer I get the message:

DeprecationWarning: ipykernel.datapub is deprecated. It has moved to ipyparallel.datapub

**What steps will reproduce the problem?**

1. open spyder
2. run a script 
3. click on anything in the variable explorer

**What is the expected output? What do you see instead?**


**Please provide any additional information below**


## Versions and main components

* Spyder Version: 3.2.4
* Python Version: 3.5
* Qt Version: 5.6.2
* PyQt Version: 5.6.0
* Operating system: Mac


## Dependencies

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:
IPython >=4.0    :  5.3.0 (OK)
cython >=0.21    :  0.25.2 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
numpy >=1.7      :  1.13.1 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
psutil >=0.3     :  5.2.2 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.5.6 (OK)
sympy >=0.7.3    :  1.0 (OK)



Discussion:
Please post a screenshot of what you're seeing. Also, please let us know what's your `ipykernel` version.
Here is the screenshot:
![error](https://user-images.githubusercontent.com/24722578/32110671-18038d7a-bb06-11e7-971e-bd57578f34bf.jpeg)

and just in case here is the text:
Traceback (most recent call last):

  File "<ipython-input-5-6eb4fbadf212>", line 1, in <module>
    get_ipython().kernel.get_value('A')

  File "/Users/joshuakaron/anaconda/lib/python3.5/site-packages/spyder/utils/ipython/spyder_kernel.py", line 159, in get_value
    publish_data({'__spy_data__': value})

  File "/Users/joshuakaron/anaconda/lib/python3.5/site-packages/ipykernel/datapub.py", line 59, in publish_data
    warnings.warn("ipykernel.datapub is deprecated. It has moved to ipyparallel.datapub", DeprecationWarning)

DeprecationWarning: ipykernel.datapub is deprecated. It has moved to ipyparallel.datapub

Im using IPython 5.3.0

Thanks in advance!


This error is coming up when I try to use the basic Spyder features such as the variable explorer and debugging mode. I use Spyder alot for my work and this is really putting me behind. Any help would be much appreciated. Thanks.  
Please post the output you get when you run in a terminal (cmd.exe)

    conda list

to better understand what's happening.
<details>
_license                  1.1                      py35_1  
_nb_ext_conf              0.3.0                    py35_0  
alabaster                 0.7.10                   py35_0  
anaconda                  custom                   py35_0  
anaconda-clean            1.0.0                    py35_0  
anaconda-client           1.6.3                    py35_0  
anaconda-navigator        1.6.2                    py35_0  
anaconda-project          0.6.0                    py35_0  
appnope                   0.1.0                    py35_0  
appscript                 1.0.1                    py35_0  
argcomplete               1.0.0                    py35_1  
asn1crypto                0.22.0                   py35_0  
astroid                   1.4.9                    py35_0  
astropy                   2.0.1               np113py35_0  
babel                     2.4.0                    py35_0  
backports                 1.0                      py35_0  
backports.functools_lru_cache 1.4                      py35_1    conda-forge
basemap                   1.0.7               np113py35_0  
beautifulsoup4            4.6.0                    py35_0  
bitarray                  0.8.1                    py35_0  
blas                      1.1                    openblas    conda-forge
blaze                     0.10.1                   py35_0  
bleach                    1.5.0                    py35_0  
bokeh                     0.12.5                   py35_1  
boto                      2.46.1                   py35_0  
bottleneck                1.2.1               np113py35_0  
cffi                      1.10.0                   py35_0  
chardet                   3.0.3                    py35_0  
chest                     0.2.3                    py35_0  
click                     6.7                      py35_0  
cloudpickle               0.2.2                    py35_0  
clyent                    1.2.2                    py35_0  
colorama                  0.3.9                    py35_0  
conda                     4.3.29                   py35_0    conda-forge
conda-build               1.20.0                   py35_0  
conda-env                 2.6.0                         0    conda-forge
conda-manager             0.3.1                    py35_0  
configobj                 5.0.6                    py35_0  
contextlib2               0.5.5                    py35_0  
cryptography              1.8.1                    py35_0  
curl                      7.49.0                        1  
cx-Oracle                 6.0b2                     <pip>
cycler                    0.10.0                   py35_0  
cython                    0.25.2                   py35_0  
cytoolz                   0.8.2                    py35_0  
dask                      0.14.3                   py35_1  
datashader                0.3.0                    py35_0  
datashape                 0.5.4                    py35_0  
decorator                 4.0.11                   py35_0  
dill                      0.2.5                    py35_0  
distributed               1.16.3                   py35_0  
docutils                  0.13.1                   py35_0  
dynd-python               0.7.2                    py35_0  
earthengine-api           0.1.99                    <pip>
entrypoints               0.2.2                    py35_1  
ephem                     3.7.6.0                  py35_0  
et_xmlfile                1.0.1                    py35_0  
fastcache                 1.0.2                    py35_1  
filelock                  2.0.6                    py35_0  
flask                     0.12.2                   py35_0  
flask-cors                3.0.2                    py35_0  
freetype                  2.7                           1    conda-forge
gdal                      2.1.0                    py35_0  
geos                      3.5.0                         0  
geotiff                   1.4.1                         0  
get_terminal_size         1.0.0                    py35_0  
gevent                    1.2.1                    py35_0  
glue-core                 0.10.4                   py35_0  
glue-vispy-viewers        0.7.2                    py35_0  
glueviz                   0.10.4                   py35_0  
google-api-python-client  1.5.5                     <pip>
greenlet                  0.4.12                   py35_0  
h5py                      2.7.0               np113py35_0  
hdf4                      4.2.12                        1  
hdf5                      1.8.17                        1  
heapdict                  1.0.0                    py35_1  
html5lib                  0.999                    py35_0  
httplib2                  0.9.2                     <pip>
icu                       54.1                          0  
idna                      2.5                      py35_0  
imagesize                 0.7.1                    py35_0  
ipykernel                 4.6.1                    py35_0  
ipyparallel               6.0.2                    py35_0    conda-forge
ipython                   5.3.0                    py35_0  
ipython_genutils          0.2.0                    py35_0  
ipywidgets                6.0.0                    py35_0  
isort                     4.2.5                    py35_0  
itsdangerous              0.24                     py35_0  
jbig                      2.1                           0  
jdcal                     1.3                      py35_0  
jedi                      0.10.2                   py35_2  
jinja2                    2.9.6                    py35_0  
jpeg                      9b                            0  
jsonschema                2.6.0                    py35_0  
jupyter                   1.0.0                    py35_3  
jupyter_client            5.0.1                    py35_0  
jupyter_console           5.1.0                    py35_0  
jupyter_core              4.3.0                    py35_0  
kealib                    1.4.6                         3    conda-forge
lazy-object-proxy         1.2.2                    py35_0  
libdynd                   0.7.2                         0  
libgdal                   2.1.0                         0  
libgfortran               3.0.0                         0    conda-forge
libiconv                  1.14                          0  
libnetcdf                 4.4.1                         1  
libpng                    1.6.28                        1    conda-forge
libtiff                   4.0.6                         3  
libxml2                   2.9.4                         0  
libxslt                   1.1.29                        0  
llvmlite                  0.19.0                   py35_0  
locket                    0.2.0                    py35_1  
lxml                      3.7.3                    py35_0  
markupsafe                0.23                     py35_2  
matplotlib                2.1.0                    py35_0    conda-forge
mistune                   0.7.4                    py35_0  
mkl                       2017.0.1                      0  
mkl-service               1.1.2                    py35_3  
mpmath                    0.19                     py35_1  
msgpack-python            0.4.8                    py35_0  
multipledispatch          0.4.9                    py35_0  
navigator-updater         0.1.0                    py35_0  
nb_anacondacloud          1.2.0                    py35_0  
nb_conda                  2.0.0                    py35_0  
nb_conda_kernels          2.0.0                    py35_0  
nbconvert                 5.1.1                    py35_0  
nbformat                  4.3.0                    py35_0  
nbpresent                 3.0.2                    py35_0  
networkx                  1.11                     py35_0  
nltk                      3.2.3                    py35_0  
nose                      1.3.7                    py35_1  
notebook                  5.0.0                    py35_0  
numba                     0.34.0              np113py35_5  
numexpr                   2.6.2               np113py35_0  
numpy                     1.13.3          py35_blas_openblas_200  [blas_openblas]  conda-forge
numpydoc                  0.6.0                    py35_0  
oauth2client              4.0.0                     <pip>
odo                       0.5.0                    py35_1  
olefile                   0.44                     py35_0  
openblas                  0.2.19                        2    conda-forge
opencv3                   3.1.0                    py35_0    menpo
openpyxl                  2.4.7                    py35_0  
openssl                   1.0.2l                        0  
packaging                 16.8                     py35_0  
pandas                    0.20.3                   py35_0  
pandasql                  0.7.3                    py35_0  
pandocfilters             1.4.1                    py35_0  
partd                     0.3.8                    py35_0  
path.py                   10.3.1                   py35_0  
pathlib2                  2.2.1                    py35_0  
patsy                     0.4.1                    py35_0  
pep8                      1.7.0                    py35_0  
pexpect                   4.2.1                    py35_0  
pickleshare               0.7.4                    py35_0  
pillow                    4.3.0                    py35_0    conda-forge
pip                       9.0.1                    py35_1  
pkginfo                   1.3.2                    py35_0  
ply                       3.10                     py35_0  
proj4                     4.9.2                         0  
prompt_toolkit            1.0.14                   py35_0  
psutil                    5.2.2                    py35_0  
ptyprocess                0.5.1                    py35_0  
py                        1.4.33                   py35_0  
pyasn1                    0.1.9                    py35_0  
pyasn1-modules            0.0.8                     <pip>
pycodestyle               2.3.1                    py35_0    conda-forge
pycosat                   0.6.2                    py35_0  
pycparser                 2.17                     py35_0  
pycrypto                  2.6.1                    py35_6  
pycurl                    7.43.0                   py35_0  
pyflakes                  1.5.0                    py35_0  
pygments                  2.2.0                    py35_0  
pylint                    1.6.4                    py35_1  
pyodbc                    4.0.16                   py35_0  
pyopengl                  3.1.1a1             np113py35_0  
pyopenssl                 17.0.0                   py35_0  
pyparsing                 2.1.4                    py35_0  
pyqt                      5.6.0                    py35_1  
pyqtgraph                 0.10.0                   py35_2    conda-forge
pytables                  3.3.0               np113py35_0  
pytest                    3.0.7                    py35_0  
python                    3.5.3                         1  
python-dateutil           2.6.0                    py35_0  
python-docx               0.8.6                     <pip>
python.app                1.2                      py35_4  
pytz                      2017.2                   py35_0  
pywavelets                0.5.2               np113py35_0  
pyyaml                    3.12                     py35_0  
pyzmq                     16.0.2                   py35_0  
qt                        5.6.2                         2  
qtawesome                 0.4.4                    py35_0  
qtconsole                 4.3.1                    py35_0    conda-forge
qtpy                      1.2.1                    py35_0  
readline                  6.2                           2  
redis                     3.2.0                         0  
redis-py                  2.10.5                   py35_0  
requests                  2.14.2                   py35_0  
rope                      0.9.4                    py35_1  
rsa                       3.4.2                     <pip>
ruamel_yaml               0.11.14                  py35_1  
scikit-image              0.13.0              np113py35_0  
scikit-learn              0.18.2                    <pip>
scikit-learn              0.19.1          py35_blas_openblas_200  [blas_openblas]  conda-forge
scipy                     0.19.1          py35_blas_openblas_202  [blas_openblas]  conda-forge
seaborn                   0.7.1                    py35_0  
setuptools                27.2.0                   py35_0  
simplegeneric             0.8.1                    py35_1  
singledispatch            3.4.0.3                  py35_0  
sip                       4.18                     py35_0  
six                       1.10.0                   py35_0  
snowballstemmer           1.2.1                    py35_0  
sockjs-tornado            1.0.3                    py35_0  
sortedcollections         0.5.3                    py35_0  
sortedcontainers          1.5.7                    py35_0  
sphinx                    1.5.6                    py35_0  
sphinx_rtd_theme          0.1.9                    py35_0  
spyder                    3.2.4                    py35_0    conda-forge
sqlalchemy                1.1.9                    py35_0  
sqlite                    3.13.0                        0  
statsmodels               0.8.0               np113py35_0  
sympy                     1.0                      py35_0  
tbb                       4.3_20141023                  0    menpo
tblib                     1.3.2                    py35_0  
terminado                 0.6                      py35_0  
testpath                  0.3                      py35_0  
tk                        8.5.18                        0  
toolz                     0.8.2                    py35_0  
tornado                   4.5.1                    py35_0  
traitlets                 4.3.2                    py35_0  
unicodecsv                0.14.1                   py35_0  
unixodbc                  2.3.4                         0  
uritemplate               3.0.0                     <pip>
wcwidth                   0.1.7                    py35_0  
werkzeug                  0.12.2                   py35_0  
wheel                     0.29.0                   py35_0  
widgetsnbextension        2.0.0                    py35_0  
wrapt                     1.10.10                  py35_0  
xarray                    0.9.6                    py35_0  
xerces-c                  3.1.4                         0  
xlrd                      1.0.0                    py35_0  
xlsxwriter                0.9.6                    py35_0  
xlwings                   0.10.4                   py35_0  
xlwt                      1.2.0                    py35_0  
xz                        5.2.2                         1  
yaml                      0.1.6                         0  
zeromq                    4.1.3                         0  
zict                      0.1.2                    py35_0  
zlib                      1.2.8                         3  
</details>

Thanks
What happens if you remove `ipyparallel` with

    conda remove ipyparallel

? Do things work as expected again?
It didnt help.

On Mon, Oct 30, 2017 at 5:48 PM, Carlos Cordoba <notifications@github.com>
wrote:

> What happens if you remove ipyparallel with
>
> conda remove ipyparallel
>
> ? Do things work as expected again?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5591#issuecomment-340595090>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AXk8krfkmLHQWKvca5lIeQOcEqQurOxyks5sxkQggaJpZM4QJKGO>
> .
>

Sorry to hear it. We'll come up with a solution as soon as we can.
In the meantime, could you create a new conda environment and try to start Spyder in that env? You can do that with this command

    conda create -n myenv spyder
Thanks for your help! how long do these things take to fix generally?

On Mon, Oct 30, 2017 at 6:05 PM, Carlos Cordoba <notifications@github.com>
wrote:

> In the meantime, could you create a new conda environment and try to start
> Spyder in that env? You can do that with this command
>
> conda create -n myenv spyder
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5591#issuecomment-340599054>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AXk8kiG3liemma0orVwnXfDL_-5JLqJ5ks5sxkgygaJpZM4QJKGO>
> .
>

@dalthviz, the solution to this one is to skip the warning generated by `ipykernel` in our `sitecustomize`, in the same way as we do for some Pandas warnings here:

https://github.com/spyder-ide/spyder/blob/3.x/spyder/utils/site/sitecustomize.py#L300
> Thanks for your help! how long do these things take to fix generally?

@JoshKaron, we do monthly bug fix releases of Spyder 3, so the fix for this one will be available in a couple of weeks.

Resolving patch:
diff --git a/spyder/utils/site/sitecustomize.py b/spyder/utils/site/sitecustomize.py
--- a/spyder/utils/site/sitecustomize.py
+++ b/spyder/utils/site/sitecustomize.py
@@ -17,7 +17,7 @@
 import shlex
 import sys
 import time
-
+import warnings
 
 PY2 = sys.version[0] == '2'
 
@@ -280,6 +280,13 @@ def __init__(self, *args, **kwargs):
         TestProgram.__init__(self, *args, **kwargs)
 unittest.main = IPyTesProgram
 
+# Filter warnings that appear for ipykernel when interacting with
+# the Variable explorer (i.e trying to see a variable)
+# Fixes Issue 5591
+warnings.filterwarnings(action='ignore', category=DeprecationWarning,
+                        module='ipykernel.datapub',
+                        message=".*ipykernel.datapub is deprecated.*")
+
 
 #==============================================================================
 # Pandas adjustments
@@ -295,7 +302,6 @@ def __init__(self, *args, **kwargs):
     # >>> import pandas as pd, numpy as np
     # >>> pd.Series([np.nan,np.nan,np.nan],index=[1,2,3])
     # Fixes Issue 2991
-    import warnings
     # For 0.18-
     warnings.filterwarnings(action='ignore', category=RuntimeWarning,
                             module='pandas.core.format',


Test patch: