question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

similarity is broken with ipython 6.3

See original GitHub issue

How to reproduce the behaviour

nlp('food').similarity('banana')
Traceback (most recent call last):
  File "/Users/hadilsabbagh/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-6-cbaa3a8ed4b6>", line 1, in <module>
    nlp('food').similarity('banana')
  File "doc.pyx", line 316, in spacy.tokens.doc.Doc.similarity
AttributeError: 'str' object has no attribute 'vector_norm'
nlp('food').similarity(nlp('banana'))
Out[7]: -2.3323391143971321e-21

Your Environment

  • Operating System: Mac OS X 10.13.4
  • Python Version Used: 3.6, IPython 6.3.1
  • spaCy Version Used: 2.0.11
  • Environment Information: Used by Jupyter, PyCharm Python Console and debugger

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
austinwishcommented, May 25, 2018

@ines I checked and I had numpy 1.14.0. I ran conda update --all and now it seems to be working. For reference, here is the packages that were updated:

The following NEW packages will be INSTALLED:

    backcall:            0.1.0-py36_0                          
    blas:                1.0-mkl                               
    blosc:               1.14.3-hd9629dc_0                     
    ftfy:                4.4.3-py36_0                          
    kiwisolver:          1.0.1-py36h792292d_0                  
    mkl_fft:             1.0.1-py36h917ab60_0                  
    mkl_random:          1.0.1-py36h78cc56f_0                  
    more-itertools:      4.1.0-py36_0                          
    numpy-base:          1.14.3-py36h479e554_1                 
    pytest-arraydiff:    0.2-py36_0                            
    pytest-astropy:      0.3.0-py36_0                          
    pytest-doctestplus:  0.1.3-py36_0                          
    pytest-openfiles:    0.3.0-py36_0                          
    pytest-remotedata:   0.2.1-py36_0                          
    snappy:              1.1.7-he62c110_3                      

The following packages will be UPDATED:

    anaconda-client:     1.6.9-py36_0                           --> 1.6.14-py36_0            
    anaconda-navigator:  1.7.0-py36_0                           --> 1.8.5-py36_0             
    astroid:             1.6.1-py36_0                           --> 1.6.3-py36_0             
    astropy:             2.0.3-py36h1de35cc_0                   --> 3.0.2-py36h917ab60_1     
    attrs:               17.4.0-py36_0                          --> 18.1.0-py36_0            
    bleach:              2.1.2-py36_0                           --> 2.1.3-py36_0             
    bokeh:               0.12.13-py36h2f9c1c0_0                 --> 0.12.16-py36_0           
    bzip2:               1.0.6-hd86a083_4                       --> 1.0.6-h1de35cc_5         
    certifi:             2018.4.16-py36_0           conda-forge --> 2018.4.16-py36_0         
    cffi:                1.11.4-py36h342bebf_0                  --> 1.11.5-py36h342bebf_0    
    cloudpickle:         0.5.2-py36_1                           --> 0.5.3-py36_0             
    conda:               4.5.4-py36_0               conda-forge --> 4.5.4-py36_0             
    conda-build:         3.4.1-py36_0                           --> 3.10.5-py36_0            
    cryptography:        2.1.4-py36h842514c_0                   --> 2.2.2-py36h1de35cc_0     
    curl:                7.58.0-ha441bb4_0                      --> 7.60.0-ha441bb4_0        
    cython:              0.27.3-py36h6ecb376_0                  --> 0.28.2-py36h1de35cc_0    
    cytoolz:             0.8.2-py36_0               conda-forge --> 0.8.2-py36h290905f_0     
    dask:                0.16.1-py36_0                          --> 0.17.5-py36_0            
    dask-core:           0.16.1-py36_0                          --> 0.17.5-py36_0            
    dbus:                1.12.2-h5243cc1_1                      --> 1.13.2-h760590f_1        
    decorator:           4.2.1-py36_0                           --> 4.3.0-py36_0             
    dill:                0.2.7.1-py36_0             conda-forge --> 0.2.7.1-py36hdf89ffe_0   
    distributed:         1.20.2-py36_0                          --> 1.21.8-py36_0            
    filelock:            2.0.13-py36hf9de95b_0                  --> 3.0.4-py36_0             
    flask:               0.12.2-py36h5658096_0                  --> 1.0.2-py36_1             
    flask-cors:          3.0.3-py36h7387b97_0                   --> 3.0.4-py36_0             
    gevent:              1.2.2-py36ha70b9d6_0                   --> 1.3.0-py36h1de35cc_0     
    glib:                2.53.6-h33f6a65_2                      --> 2.56.1-h35bc53a_0        
    greenlet:            0.4.12-py36hf09ba7b_0                  --> 0.4.13-py36h1de35cc_0    
    imageio:             2.2.0-py36h5e01289_0                   --> 2.3.0-py36_0             
    imagesize:           0.7.1-py36h3495948_0                   --> 1.0.0-py36_0             
    intel-openmp:        2018.0.0-h8158457_8                    --> 2018.0.0-8               
    ipykernel:           4.8.0-py36_0                           --> 4.8.2-py36_0             
    ipython:             6.2.1-py36h3dda519_1                   --> 6.4.0-py36_0             
    ipywidgets:          7.1.1-py36_0                           --> 7.2.1-py36_0             
    isort:               4.2.15-py36hceb2a01_0                  --> 4.3.4-py36_0             
    jdcal:               1.3-py36h1986823_0                     --> 1.4-py36_0               
    jedi:                0.11.1-py36_0                          --> 0.12.0-py36_1            
    jupyter_client:      5.2.2-py36_0                           --> 5.2.3-py36_0             
    jupyterlab:          0.31.5-py36_0                          --> 0.32.1-py36_0            
    jupyterlab_launcher: 0.10.2-py36_0                          --> 0.10.5-py36_0            
    libcurl:             7.58.0-hf30b1f0_0                      --> 7.60.0-hf30b1f0_0        
    libedit:             3.1-hb4e282d_0                         --> 3.1.20170329-hb402a30_2  
    libsodium:           1.0.15-hd9e47c5_0                      --> 1.0.16-h3efe00b_0        
    libtiff:             4.0.9-h0dac147_0                       --> 4.0.9-hcb84e12_1         
    libxml2:             2.9.7-hab757c2_0                       --> 2.9.8-hab757c2_1         
    llvmlite:            0.21.0-py36hff739e7_0                  --> 0.23.1-py36hc454e04_0    
    lxml:                4.1.1-py36hef8c89e_1                   --> 4.2.1-py36h7166777_0     
    matplotlib:          2.1.2-py36h6d6146d_0                   --> 2.2.2-py36ha7267d0_0     
    mistune:             0.8.3-py36_0                           --> 0.8.3-py36h1de35cc_1     
    mkl:                 2018.0.1-hfbd8650_4                    --> 2018.0.2-1               
    msgpack-numpy:       0.4.3-py_0                 conda-forge --> 0.4.3-py36_0             
    multipledispatch:    0.4.9-py36hc5f92b5_0                   --> 0.5.0-py36_0             
    navigator-updater:   0.1.0-py36h7aee5fb_0                   --> 0.2.0-py36_0             
    ncurses:             6.0-hd04f020_2                         --> 6.1-h0a44026_0           
    nltk:                3.2.5-py36h1190bce_0                   --> 3.3.0-py36_0             
    notebook:            5.4.0-py36_0                           --> 5.5.0-py36_0             
    numba:               0.36.2-np114py36hc2f221f_0             --> 0.38.0-py36h1702cab_0    
    numexpr:             2.6.4-py36habcfcfe_0                   --> 2.6.5-py36h057f876_0     
    numpy:               1.14.0-py36h8a80b8c_1                  --> 1.14.3-py36h9bb19eb_1    
    numpydoc:            0.7.0-py36he54d08e_0                   --> 0.8.0-py36_0             
    openpyxl:            2.4.10-py36_0                          --> 2.5.3-py36_0             
    openssl:             1.0.2o-0                   conda-forge --> 1.0.2o-h26aff7b_0        
    packaging:           16.8-py36he5e8135_0                    --> 17.1-py36_0              
    pandas:              0.22.0-py36h0a44026_0                  --> 0.23.0-py36h1702cab_0    
    parso:               0.1.1-py36hc90e01c_0                   --> 0.2.0-py36_0             
    path.py:             10.5-py36h7bcb313_0                    --> 11.0.1-py36_0            
    pathlib2:            2.3.0-py36h877a6d8_0                   --> 2.3.2-py36_0             
    pcre:                8.41-hfb6ab37_1                        --> 8.42-h378b8a2_0          
    pexpect:             4.3.1-py36_0                           --> 4.5.0-py36_0             
    pillow:              5.0.0-py36hfcce615_0                   --> 5.1.0-py36hfcce615_0     
    pip:                 9.0.1-py36h1555ced_4                   --> 10.0.1-py36_0            
    pkginfo:             1.4.1-py36h25bf955_0                   --> 1.4.2-py36_1             
    ply:                 3.10-py36h10e714e_0                    --> 3.11-py36_0              
    psutil:              5.4.3-py36h1de35cc_0                   --> 5.4.5-py36h1de35cc_0     
    py:                  1.5.2-py36ha69170d_0                   --> 1.5.3-py36_0             
    pycodestyle:         2.3.1-py36h83e8646_0                   --> 2.4.0-py36_0             
    pycrypto:            2.6.1-py36h1de35cc_7                   --> 2.6.1-py36h1de35cc_8     
    pylint:              1.8.2-py36_0                           --> 1.8.4-py36_0             
    pyodbc:              4.0.22-py36h0a44026_0                  --> 4.0.23-py36h0a44026_0    
    pyopenssl:           17.5.0-py36h51e4350_0                  --> 18.0.0-py36_0            
    pyqt:                5.6.0-py36he5c6137_6                   --> 5.9.2-py36h11d3b92_0     
    pysocks:             1.6.7-py36hfa33cec_1                   --> 1.6.8-py36_0             
    pytables:            3.4.2-py36hfbd7ab0_2                   --> 3.4.3-py36h5ca999c_0     
    pytest:              3.3.2-py36_0                           --> 3.5.1-py36_0             
    python:              3.6.4-hc167b69_1                       --> 3.6.5-hc167b69_1         
    python-dateutil:     2.6.1-py36h86d2abb_1                   --> 2.7.3-py36_0             
    python.app:          2-py36h54569d5_7                       --> 2-py36_8                 
    pytz:                2017.3-py36hf0bf824_0                  --> 2018.4-py36_0            
    pyzmq:               16.0.3-py36he48b5ad_0                  --> 17.0.0-py36h1de35cc_1    
    qt:                  5.6.2-h9975529_14                      --> 5.9.5-h02808f3_0         
    qtpy:                1.3.1-py36h16bb863_0                   --> 1.4.1-py36_0             
    regex:               2017.11.09-py36_0          conda-forge --> 2017.11.09-py36hb672b4b_0
    scipy:               1.0.0-py36h1de22e9_0                   --> 1.1.0-py36hcaad992_0     
    send2trash:          1.4.2-py36_0                           --> 1.5.0-py36_0             
    setuptools:          38.4.0-py36_0                          --> 39.1.0-py36_0            
    sip:                 4.18.1-py36h2824476_2                  --> 4.19.8-py36h0a44026_0    
    sortedcollections:   0.5.3-py36he9c3ed6_0                   --> 0.6.1-py36_0             
    sortedcontainers:    1.5.9-py36_0                           --> 1.5.10-py36_0            
    spacy:               2.0.11-py36_0              conda-forge --> 2.0.11-py36h1702cab_0    
    sphinx:              1.6.6-py36_0                           --> 1.7.4-py36_0             
    spyder:              3.2.6-py36_0                           --> 3.2.8-py36_0             
    sqlalchemy:          1.2.1-py36h1de35cc_0                   --> 1.2.7-py36hb402a30_0     
    sqlite:              3.22.0-h3efe00b_0                      --> 3.23.1-hf1716c9_0        
    statsmodels:         0.8.0-py36h9c68fc9_0                   --> 0.9.0-py36h917ab60_0     
    termcolor:           1.1.0-py36_1               conda-forge --> 1.1.0-py36_1             
    tornado:             4.5.3-py36_0                           --> 5.0.2-py36_0             
    tqdm:                4.23.3-py_0                conda-forge --> 4.23.3-py36_0            
    typing:              3.6.2-py36haa2d9ef_0                   --> 3.6.4-py36_0             
    unixodbc:            2.3.4-h4cb4dde_1                       --> 2.3.6-h3efe00b_0         
    wheel:               0.30.0-py36h5eb2c71_1                  --> 0.31.1-py36_0            
    widgetsnbextension:  3.1.0-py36_0                           --> 3.2.1-py36_0             
    xlsxwriter:          1.0.2-py36h3736301_0                   --> 1.0.4-py36_0             
    xlwings:             0.11.5-py36_0                          --> 0.11.8-py36_0            
    xz:                  5.2.3-h0278029_2                       --> 5.2.4-h1de35cc_4         
    zeromq:              4.2.2-ha360ad0_2                       --> 4.2.5-h378b8a2_0         

The following packages will be DOWNGRADED:

    ca-certificates:     2018.4.16-0                conda-forge --> 2018.03.07-0             
    msgpack-python:      0.5.1-py36h04f5b5a_0                   --> 0.4.8-py36h46767b2_0 
0reactions
lock[bot]commented, Jun 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do when things go wrong - The Jupyter Notebook
Try running jupyter-notebook (with a hyphen). This should normally be the same as jupyter notebook (with a space), but if there's any difference,...
Read more >
What is the difference between `jupyter notebook` and `jupyter ...
Jupyter Notebook ( notebook module) contains both: the server for notebooks (the backend of the web application that hosts the notebook ...
Read more >
Jupyter Notebook Documentation - Read the Docs
The normal workflow in a notebook is, then, quite similar to a standard IPython session, with the difference that you.
Read more >
How to Effortlessly Optimize Your Jupyter Notebook | by Anne ...
There are a ton of simple ways to make your Jupyter Notebooks better, faster, stronger, sexier, and so much more fun to work...
Read more >
News - IPython
IPython 6.3 was released on April 2, 2018. ... For 4.0, we will split up components into several packages. The parts which work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found