Coder Social home page Coder Social logo

jupyter-tabnine's Introduction

TabNine for Jupyter Notebook

This plugin has been created by wenmin-wu.

This plugin has been tested on MacOS, Linux and Windows, it support all these systems. For browsers it supports Chrome and Safari but not IE

If you found this plugin doesn't work for you, please debug according to How to Debug. And if you can't figure out what's wrong, please release an issue and report the logs in detail.

Thanks for using this plugin! Have fun! :)

Read this in other languages: English, 中文

jupyter-tabnine

This extension for Jupyter Notebook enables the use of coding auto-completion based on Deep Learning.

Other client plugins of TabNine require starting a child process for TabNine binary and using Pipe for communication. This can’t be done with Jupyter Notebook, since child process can’t be created with JQuery and Jupyter Notebook doesn’t provide any way for adding third-part js libs to plugins.

In this repository, it is achived by developing a client plugin and a server plugin for Jupyter Notebook. The client plugin generate request info and send http request to the server plugin. The server plugin pass the request info to it’s client process (TabNine) and return the request to client plugin.

Installation

I saw a lot users came across problems due to didn't install and configure this plugin correctly, the simplest way to install and configure this plugin is by issuing following command:

pip3 install jupyter-tabnine --user
jupyter nbextension install --py jupyter_tabnine --user
jupyter nbextension enable --py jupyter_tabnine --user
jupyter serverextension enable --py jupyter_tabnine --user

If you want to install and configure in a customized way, you can refer to following:

The extension consists of a pypi package that includes a javascript notebook extension, along with a python jupyter server extension. Since Jupyter 4.2, pypi is the recommended way to distribute nbextensions. The extension can be installed:

  • from the master version on the github repo (this will be always the most recent version)

  • via pip for the version hosted on pypi

From the github repo or from Pypi,

  1. install the package

    • pip3 install https://github.com/wenmin-wu/jupyter-tabnine/archive/master.zip [--user][--upgrade]

    • or pip3 install jupyter-tabnine [--user][--upgrade]

    • or clone the repo and install

      git clone https://github.com/wenmin-wu/jupyter-tabnine.git

      python3 setup.py install

  2. install the notebook extension jupyter nbextension install --py jupyter_tabnine [--user|--sys-prefix|--system]

  3. and enable notebook extension and server extension

    jupyter nbextension enable --py jupyter_tabnine [--user|--sys-prefix|--system]
    jupyter serverextension enable --py jupyter_tabnine [--user|--sys-prefix|--system]

For Jupyter versions before 4.2, the situation after step 1 is more tricky, since the --py option isn’t available, so you will have to find the location of the source files manually as follows (instructions adapted from @jcb91’s jupyter_highlight_selected_word). Execute

python -c "import os.path as p; from jupyter_tabnine import __file__ as f, _jupyter_nbextension_paths as n; print(p.normpath(p.join(p.dirname(f), n()[0]['src'])))"

Then, issue

jupyter nbextension install <output source directory>
jupyter nbextension enable jupyter_tabnine/main
jupyter serverextension enable <output source directory>

where <output source directory> is the output of the first python command.

Usage

  • Jupyter TabNine will be active after being installed. Sometimes, you may want to show the Jupyter original complete temporally, then click shift + space.

    show original complete demo

  • Remote auto-completion server is also supported. You may want this to speed up the completion request handing. Or maybe your company want to deploy a compeltion server cluster that services everyone. Read following to learn how to deploy remote server.

Uninstallation

To uninstall TabNine plugin from mac/linux run the following commands:

jupyter nbextension uninstall --py jupyter_tabnine
pip3 uninstall jupyter-tabnine

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT License

Remote Completion Server Deployment

It's useful to deploy a remote tabnine server if you don't want to occupy too much local resources. You can build, deploy and config a remote tabnine server according to the following steps.

NOTE: You need to install jupyter-tabnine with pip3 install https://github.com/wenmin-wu/jupyter-tabnine/archive/master.zip, because the version which fix this plugin with remote server problem haven't been relased to PyPi.

Build Server Image

I have uploaded an image to Docker Hub, skip this section if you prefer to use it directly.

  • Install the golang (recommended version is 1.13 - 1.14)
  • Issue go get -v github.com/wenmin-wu/jupyter-tabnine/go/cmd
  • Issue cd $HOME/go/src/github.com/wenmin-wu/jupyter-tabnine
  • Issue bash ./build-image.sh

Start Server

Change the image name in this bash script to wuwenmin1991/tabnine-server:1.0 if you did't build your own image

  • Simply issue bash start-server.sh

Configure Under Nbextensions

  • Please install Nbextensions if you haven't installed.
  • Open Jupyter Notebook and go to the Nbextensions setting page, click Jupyter TabNine, scroll down and fill in the remote server url, e.g. remote-server-url-config

Stop Server

  • Simply issue bash stop-server.sh

Stargazers over time

Stargazers over time

jupyter-tabnine's People

Contributors

bilucodota avatar boaz-codota avatar dimacodota avatar drorweiss avatar hetp111 avatar magetron avatar shaiahr avatar wenmin-wu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter-tabnine's Issues

Hey Yo not working on Brave unfortunately :-(

Doesn't work on Brave browser Version 1.11.104 Chromium: 84.0.4147.105 (Official Build) (64-bit)
VM122:1 GET http://localhost:8891/tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%22Untitled3.py%22%2C%22before%22%3A%22i%22%2C%22after%22%3A%22%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D 404 (Not Found) (anonymous) @ VM122:1 send @ jquery.min.js:9837 ajax @ jquery.min.js:9434 jQuery.<computed> @ jquery.min.js:9583 requestComplterServer @ main.js?v=20200731090036:119 DeepCompleter.finish_completing @ main.js?v=20200731090036:240 proxy @ jquery.min.js:10502 (anonymous) @ kernel.js:1041 Promise.then (async) Kernel._handle_shell_reply @ kernel.js:1041 Kernel._finish_ws_message @ kernel.js:1014 (anonymous) @ kernel.js:1007 Promise.then (async) Kernel._handle_ws_message @ kernel.js:1007 proxy @ jquery.min.js:10502 main.js?v=20200731090036:123 [nbextensions/jupyter_tabnine/main] get error:

Seems not work for macos?

Hi,
I just installed tabnine , installation process seems ok but not prompting any thing at all coding in jupyter, the server shows the following err :
OSError: [Errno 8] Exec format error: '/anaconda3/lib/python3.6/site-packages/jupyter_tabnine/binaries/2.1.21/x86_64-apple-darwin/TabNine'
Wonder if it support mac os ?

binary support question

Installing on SmartOS (SunOS/illumOS) goes fine but then objects inside init with:

get_tabnine_sub_path system = _SYSTEM_MAPPING[platform.system()] 
KeyError: 'SunOS'

which seems to be related to downloading a binary. It is not totally beyond the realm of possibillity that I could successfully compile something (never an easy task in SunOS variants). On the other hand, is the binary needed the same as the server run remotely, then it takes 30seconds to spin up a very thin virtual linux box.

Thank you,
Eric

Support for jupyter notebooks on VSCode

Hi, since native support for jupyter notebooks has recently been announced on VSCode:
Is there any way for Tabnine to work in these files?
Is their support planned?

Thank you!

Downloading tabnine binary after installing: Permission denied

I have successfully installed TabNine, but the extension fails to download the binary files after starting the notebook:

[INFO 2020-03-14 16:11:04.407 TabNine]: install dir: /usr/local/lib/python3.6/dist-packages/jupyter_tabnine
[INFO 2020-03-14 16:11:04.464 TabNineDownloader]: Begin to download TabNine Binary from https://update.tabnine.com/2.5.1/x86_64-unknown-linux-gnu/TabNine
[ERROR 2020-03-14 16:11:04.465 TabNineDownloader]: Download failed, error: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/jupyter_tabnine/binaries'

I have tried to manually download the binary file from the link, place it inside the folder and restart jupyter but I then get a error when acessing the file:

[INFO 2020-03-14 16:23:16.306 TabNine]: install dir: /usr/local/lib/python3.6/dist-packages/jupyter_tabnine
[W 16:23:16.307 NotebookApp] Error loading server extension jupyter_tabnine
Traceback (most recent call last):
File "/home/bcoelho/.local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1346, in init_server_extensions
func(self)
File "/usr/local/lib/python3.6/dist-packages/jupyter_tabnine/init.py", line 29, in load_jupyter_server_extension
tabnine = TabNine()
File "/usr/local/lib/python3.6/dist-packages/jupyter_tabnine/tabnine.py", line 73, in init
self.download_if_needed()
File "/usr/local/lib/python3.6/dist-packages/jupyter_tabnine/tabnine.py", line 127, in download_if_needed
os.chmod(tabnine_path, 0o755)
PermissionError: [Errno 1] Operation not permitted: '/usr/local/lib/python3.6/dist-packages/jupyter_tabnine/binaries/2.5.1/x86_64-unknown-linux-gnu/TabNine'

Is there any way to specify a install directory for example to fix this?

TabNine::sem not working

I tried to enable TabNine::sem but it returned error saying command failed is pip install python-language-server. I installed the package manually as well. But still not working.

Also, is it possible to use this module for jupyter lab?-

Seems like it doesn't work on my jupyter

Have restarted my jupyter server for times, but it still doesn't work on my jupyter

The inspection is as follow, seems like some network problems happen, why?

image

Themes Maybe? feature request

Im using onedork theme with jupytertheme plugin. it would be great if this plugin natively reacts to it or it may have a seperate theme. The translucent window is very annoying.
thx for the plugin tho very easy to use.

I followed the installation steps but it did not work.

404 GET /tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%22Untitled.py%22%2C%22before%22%3A%22impo%22%2C%22after%22%3A%22%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D (::1) 6.05ms referer=None

I am getting this error in the console log.

Also i tried running jupyter nbextension list

Known nbextensions:
config dir: C:\Users\sidha.jupyter\nbconfig
notebook section
jupyter_tabnine/main enabled
- Validating: ok
config dir: c:\users\sidha\appdata\local\programs\python\python38-32\etc\jupyter\nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: ok

ModuleNotFoundError: No module named 'jupyter_tabnine'

I tried to install jupyter tabnine extension like this:

pip3 install jupyter-tabnine
jupyter nbextension install

with the second command I have this error:

Installing /home/rouizi/.local/lib/python3.6/site-packages/jupyter_tabnine/static -> jupyter_tabnine
Traceback (most recent call last):
  File "/home/rouizi/.local/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 268, in 
launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/rouizi/.local/lib/python3.6/site-packages/traitlets/config/application.py", line 664, in 
launch_instance
    app.start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 983, in start
    super(NBExtensionApp, self).start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/application.py", line 257, in start
    self.subapp.start()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 711, in start
    self.install_extensions()
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 690, in 
install_extensions
    **kwargs
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 220, in 
install_nbextension_python
    destination=dest, logger=logger
  File "/home/rouizi/.local/lib/python3.6/site-packages/notebook/nbextensions.py", line 121, in 
install_nbextension
    ensure_dir_exists(nbext)
  File "/home/rouizi/.local/lib/python3.6/site-packages/jupyter_core/utils/__init__.py", line 13, in 
ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/usr/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter'

So I tried with sudo:

sudo jupyter nbextension install --py jupyter_tabnine

Traceback (most recent call last):
  File "/snap/jupyter/6/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/snap/jupyter/6/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in 
launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/snap/jupyter/6/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in 
launch_instance
    app.start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 988, in start
    super(NBExtensionApp, self).start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 716, in start
    self.install_extensions()
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 695, in 
install_extensions
    **kwargs
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 211, in 
install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/nbextensions.py", line 1122, in 
_get_nbextension_metadata
    m = import_item(module)
  File "/snap/jupyter/6/lib/python3.7/site-packages/traitlets/utils/importstring.py", line 42, in 
import_item
    return __import__(parts[0])
ModuleNotFoundError: No module named 'jupyter_tabnine'

How can I fix this ?

Successful installing in virtual environment but could not start jupyter.

I created a virtual environment "tabnine" with python 3.8.5 in my Ubuntu 16.04 (python3.8 -m venv tabnine).
Then, I followed 4 steps in README to install (If i used --user in the first line, it could not run):
(tabnine) pip3 install jupyter-tabnine
(tabnine) jupyter nbextension install --py jupyter_tabnine --user
(tabnine) jupyter nbextension enable --py jupyter_tabnine --user
(tabnine) jupyter serverextension enable --py jupyter_tabnine --user

Everthing was fine, but when I tried to start jupyter:
(tabnine) jupyter notebook
It returned some errors:
...
File "/usr/local/lib/python3.8/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
During handling of the above exception, another exception occurred:
...
File "/home/minh/tabnine/lib/python3.8/site-packages/notebook/services/sessions/sessionmanager.py", line 12, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'

Are there any suggestions for me Thanks all!

Feature Request: Function docs show

Hi,

great plugin. I am much more used from Java/Scala world that I have not only apis autocompletable, but I can also see api declaration (input and output parameters) and easy link to full docs, in Eclipse/Idea.

Do you consider that as extension possible to do via this plugin?

The doc can be something like this:
image

The autocompletion extended by either input and/or output parameters can look like this:
image

I myself use Idea Ultimate, where both functionalities exists, but its in paid version only...

auto completion is not working well

hello,
the tabnine seems to work but the python-language-server doesn't work.
I'm using anaconda3.

I've tried to install pyls but it doesn't install it. with error:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - pyls

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

the installation of python-language-server works but that didn't do anything inside jupyter. I tried to install that repo from the source but that didn't help either.

Is there any fix for this issue please?

PS: I think that would be great if we can add that package to https://github.com/wenmin-wu/jupyter-tabnine/blob/master/setup.py#L20 so it won't display the error later

TypeError: write() only accepts bytes, unicode, and dict objects

(mediadata) bob@hostname:~/project/media_soe$ jupyter notebook --port 5000 --no-browser
[I 12:01:24.641 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.1
[INFO 2020-03-31 12:01:24.642 TabNine]:  install dir: /home/bob/.virtualenvs/mediadata/lib/python3.6/site-packages/jupyter_tabnine
[INFO 2020-03-31 12:01:24.643 TabNine]: TabNine binary already exists in /home/bob/.virtualenvs/mediadata/lib/python3.6/site-packages/jupyter_tabnine/binaries/2.5.1/x86_64-unknown-linux-gnu/TabNine ignore downloading
[WARNING 2020-03-31 12:01:27.313 TabNine]:  wrong response of turning on semantic completion
[I 12:01:27.315 NotebookApp] Serving notebooks from local directory: /home/bob/project/media_soe
[I 12:01:27.315 NotebookApp] The Jupyter Notebook is running at:
[I 12:01:27.315 NotebookApp] http://localhost:5000/?token=0bb320619291829c2f74580820b382e36233bfec349e36e6
[I 12:01:27.315 NotebookApp]  or http://127.0.0.1:5000/?token=0bb320619291829c2f74580820b382e36233bfec349e36e6
[I 12:01:27.315 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:01:27.325 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/bob/.local/share/jupyter/runtime/nbserver-7983-open.html
    Or copy and paste one of these URLs:
        http://localhost:5000/?token=0bb320619291829c2f74580820b382e36233bfec349e36e6
     or http://127.0.0.1:5000/?token=0bb320619291829c2f74580820b382e36233bfec349e36e6
[W 12:01:32.510 NotebookApp] 404 GET /api/kernels/20be7e9c-d6a9-4a1e-a457-e147e5f9bc48/channels?session_id=e52034af673c417f9fd8db20a0c906bf (127.0.0.1): Kernel does not exist: 20be7e9c-d6a9-4a1e-a457-e147e5f9bc48
[W 12:01:32.549 NotebookApp] 404 GET /api/kernels/20be7e9c-d6a9-4a1e-a457-e147e5f9bc48/channels?session_id=e52034af673c417f9fd8db20a0c906bf (127.0.0.1) 45.41ms referer=None
[W 12:01:48.582 NotebookApp] Replacing stale connection: 20be7e9c-d6a9-4a1e-a457-e147e5f9bc48:e52034af673c417f9fd8db20a0c906bf
[I 12:01:52.360 NotebookApp] 302 GET / (127.0.0.1) 0.91ms
[I 12:02:04.074 NotebookApp] Kernel started: 5d2f6a7a-b8b9-4ff0-9988-86dd3126e0ca
[E 12:02:16.210 NotebookApp] Uncaught exception GET /tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%2201-print%2Fnotebook%2Flists-of-prints.py%22%2C%22before%22%3A%22%23%25config%20IPCompleter.greedy%3DTrue%5Cnimport%20pandas%20as%20pd%5Cnimport%20numpy%20as%20np%5Cndf%20%3D%20pd.P%22%2C%22after%22%3A%22%5Cndf%20%3D%20pd.DataFrame()%5Cnpath_data%20%3D%20%5C%22..%2Fdata%2F2019-10-22_Toutes_les_fiches_techniques_Print.xls%5C%22%5Cndf%20%3D%20pd.read_excel(path_data)%5Cndf.head()%5Cndf.columns%5Cndf.drop(%5B%27Unnamed%3A%200%27%5D%2C%20axis%3D1%2C%20inplace%3DTrue)%5Cndf.head()%5Cndf.columns%5Cnlcol%20%3D%20%5B%27number%27%2C%20%27wbs%27%2C%20%27name%27%2C%20%27pm_name%27%2C%27status%27%2C%27finished%27%2C%27recording_type%27%2C%27univers%27%2C%27notes%27%2C%27client%27%2C%27product%27%2C%27industrie%27%2C%27gfk_dep%27%2C%27collect%27%5D%5Cndf.columns%20%3D%20lcol%5Cndf.head()%5Cnimport%20numpy%20as%20np%5Cnimport%20pandas%20as%20pd%5Cnfrom%20pandas_profiling%20import%20ProfileReport%5Cnprofile%20%3D%20ProfileReport(df%2C%20title%3D%27Pandas%20Profiling%20Report%27%2C%20html%3D%7B%27style%27%3A%7B%27full_width%27%3ATrue%7D%7D)%5Cnprofile%5Cn%23df.number%20%3D%20df.number.str.replace(%27_001%27%2C%20%27%27).map(int)%5Cndf.number%20%3D%20df.number.astype(str).str%5B0%3A6%5D.map(int)%5Cndf.head()%5Cn%23%20Number%20of%20unique%20surveys%5Cnlen(df)%5Cnlen(df.number.unique())%5Cn**142**%5Cn%25%25bash%5Cnls%20~%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F%5Cnimport%20glob%5Cnimport%20os%5Cnlsurvey%20%3D%20glob.glob(os.environ%5B%27HOME%27%5D%2B%27%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F*%27)%5Cnlidfr%20%3D%20%5B%20int(i.split(%27%2F%27)%5B8%5D.split(%27%20-%20%27)%5B0%5D.replace(%27%20%27%2C%27%27))%20for%20i%20in%20lsurvey%5D%5Cnlidfr%5Cndf.number.tolist()%5Cnset(df.number.tolist())%20%26%20set(lidfr)%5Cnfind%20%2F%20-type%20d%20-name%20%5C%22dir-name-here%5C%22%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:5000', method='GET', uri='/tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%2201-print%2Fnotebook%2Flists-of-prints.py%22%2C%22before%22%3A%22%23%25config%20IPCompleter.greedy%3DTrue%5Cnimport%20pandas%20as%20pd%5Cnimport%20numpy%20as%20np%5Cndf%20%3D%20pd.P%22%2C%22after%22%3A%22%5Cndf%20%3D%20pd.DataFrame()%5Cnpath_data%20%3D%20%5C%22..%2Fdata%2F2019-10-22_Toutes_les_fiches_techniques_Print.xls%5C%22%5Cndf%20%3D%20pd.read_excel(path_data)%5Cndf.head()%5Cndf.columns%5Cndf.drop(%5B%27Unnamed%3A%200%27%5D%2C%20axis%3D1%2C%20inplace%3DTrue)%5Cndf.head()%5Cndf.columns%5Cnlcol%20%3D%20%5B%27number%27%2C%20%27wbs%27%2C%20%27name%27%2C%20%27pm_name%27%2C%27status%27%2C%27finished%27%2C%27recording_type%27%2C%27univers%27%2C%27notes%27%2C%27client%27%2C%27product%27%2C%27industrie%27%2C%27gfk_dep%27%2C%27collect%27%5D%5Cndf.columns%20%3D%20lcol%5Cndf.head()%5Cnimport%20numpy%20as%20np%5Cnimport%20pandas%20as%20pd%5Cnfrom%20pandas_profiling%20import%20ProfileReport%5Cnprofile%20%3D%20ProfileReport(df%2C%20title%3D%27Pandas%20Profiling%20Report%27%2C%20html%3D%7B%27style%27%3A%7B%27full_width%27%3ATrue%7D%7D)%5Cnprofile%5Cn%23df.number%20%3D%20df.number.str.replace(%27_001%27%2C%20%27%27).map(int)%5Cndf.number%20%3D%20df.number.astype(str).str%5B0%3A6%5D.map(int)%5Cndf.head()%5Cn%23%20Number%20of%20unique%20surveys%5Cnlen(df)%5Cnlen(df.number.unique())%5Cn**142**%5Cn%25%25bash%5Cnls%20~%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F%5Cnimport%20glob%5Cnimport%20os%5Cnlsurvey%20%3D%20glob.glob(os.environ%5B%27HOME%27%5D%2B%27%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F*%27)%5Cnlidfr%20%3D%20%5B%20int(i.split(%27%2F%27)%5B8%5D.split(%27%20-%20%27)%5B0%5D.replace(%27%20%27%2C%27%27))%20for%20i%20in%20lsurvey%5D%5Cnlidfr%5Cndf.number.tolist()%5Cnset(df.number.tolist())%20%26%20set(lidfr)%5Cnfind%20%2F%20-type%20d%20-name%20%5C%22dir-name-here%5C%22%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/bob/.virtualenvs/mediadata/lib/python3.6/site-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/home/bob/.virtualenvs/mediadata/lib/python3.6/site-packages/jupyter_tabnine/handler.py", line 14, in get
        self.write(response)
      File "/home/bob/.virtualenvs/mediadata/lib/python3.6/site-packages/tornado/web.py", line 834, in write
        raise TypeError(message)
    TypeError: write() only accepts bytes, unicode, and dict objects
[E 12:02:16.214 NotebookApp] {
      "Host": "localhost:5000",
      "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0",
      "Accept": "*/*",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "X-Requested-With": "XMLHttpRequest",
      "Connection": "keep-alive",
      "Referer": "http://localhost:5000/notebooks/01-print/notebook/lists-of-prints.ipynb",
      "Cookie": "username-localhost-5000=\"2|1:0|10:1585646585|23:username-localhost-5000|44:YjcwMmI0NjJhMDg1NDBkY2JhOTNlY2JmOGU0MDE0NTM=|b0dca45e70ea81d989d8a8f32cba9415d7a79358fb8975812ed7a4f43ae1f845\"; _xsrf=2|a827a59c|8bd2453659d2d4eb00d65b78172de365|1583854181; csrftoken=GEFigwPHZbf42XpAMDdrKSt1XNMuzWNz13UGtWil7j4cBKe3LkQwPgGp423VYjM3"
    }
[E 12:02:16.214 NotebookApp] 500 GET /tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%2201-print%2Fnotebook%2Flists-of-prints.py%22%2C%22before%22%3A%22%23%25config%20IPCompleter.greedy%3DTrue%5Cnimport%20pandas%20as%20pd%5Cnimport%20numpy%20as%20np%5Cndf%20%3D%20pd.P%22%2C%22after%22%3A%22%5Cndf%20%3D%20pd.DataFrame()%5Cnpath_data%20%3D%20%5C%22..%2Fdata%2F2019-10-22_Toutes_les_fiches_techniques_Print.xls%5C%22%5Cndf%20%3D%20pd.read_excel(path_data)%5Cndf.head()%5Cndf.columns%5Cndf.drop(%5B%27Unnamed%3A%200%27%5D%2C%20axis%3D1%2C%20inplace%3DTrue)%5Cndf.head()%5Cndf.columns%5Cnlcol%20%3D%20%5B%27number%27%2C%20%27wbs%27%2C%20%27name%27%2C%20%27pm_name%27%2C%27status%27%2C%27finished%27%2C%27recording_type%27%2C%27univers%27%2C%27notes%27%2C%27client%27%2C%27product%27%2C%27industrie%27%2C%27gfk_dep%27%2C%27collect%27%5D%5Cndf.columns%20%3D%20lcol%5Cndf.head()%5Cnimport%20numpy%20as%20np%5Cnimport%20pandas%20as%20pd%5Cnfrom%20pandas_profiling%20import%20ProfileReport%5Cnprofile%20%3D%20ProfileReport(df%2C%20title%3D%27Pandas%20Profiling%20Report%27%2C%20html%3D%7B%27style%27%3A%7B%27full_width%27%3ATrue%7D%7D)%5Cnprofile%5Cn%23df.number%20%3D%20df.number.str.replace(%27_001%27%2C%20%27%27).map(int)%5Cndf.number%20%3D%20df.number.astype(str).str%5B0%3A6%5D.map(int)%5Cndf.head()%5Cn%23%20Number%20of%20unique%20surveys%5Cnlen(df)%5Cnlen(df.number.unique())%5Cn**142**%5Cn%25%25bash%5Cnls%20~%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F%5Cnimport%20glob%5Cnimport%20os%5Cnlsurvey%20%3D%20glob.glob(os.environ%5B%27HOME%27%5D%2B%27%2Fmnt%2FWorkflow%2FCrossteam%2FSurveys%2F*%2F*%27)%5Cnlidfr%20%3D%20%5B%20int(i.split(%27%2F%27)%5B8%5D.split(%27%20-%20%27)%5B0%5D.replace(%27%20%27%2C%27%27))%20for%20i%20in%20lsurvey%5D%5Cnlidfr%5Cndf.number.tolist()%5Cnset(df.number.tolist())%20%26%20set(lidfr)%5Cnfind%20%2F%20-type%20d%20-name%20%5C%22dir-name-here%5C%22%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D (127.0.0.1) 6.58ms referer=http://localhost:5000/notebooks/01-print/notebook/lists-of-prints.ipynb

TabNine was unable to start the python semantic completion backend.

TabNine was unable to start the python semantic completion backend.
The command tried was: pyls
This means you need to install the backend manually.
For help, see tabnine.com/semantic.
Or, type TabNine::no_sem to disable semantic completion for Python.
(TabNine works well even without semantic completion.)

TabNine::sem message after install

After installation I am getting a warning message about TabNine::sem. How do I enable TabNine::sem or disable this message in your extension? The commands the warning message give do not work from inside Jupyter.

tab_nine

Thank you!

Changes in behaviour of suggestion popup

A few changes that I would suggest,

  1. The first option should be in focus by default.
  2. Navigating the options doesn't change the main code, rather the ENTER key would implement the code as well as close the window.
  3. Because the ENTER key's function is now inserting code, ESC key should be used to close the suggestion box.

I suggest these changes because they seem more natural and inline with other mainstream IDEs.

I have implemented all above mentioned changes along with fixing some typos.
If you allow, I would open a pull request for the merge.

TypeError in handler.py:self.write(response)

    Traceback (most recent call last):
      File "/home/lz/code/git/invest/2020-08-05-options/.env-new/lib/python3.8/site-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/home/lz/code/git/invest/2020-08-05-options/.env-new/lib/python3.8/site-packages/jupyter_tabnine/handler.py", line 14, in get
        self.write(response)
      File "/home/lz/code/git/invest/2020-08-05-options/.env-new/lib/python3.8/site-packages/tornado/web.py", line 834, in write
        raise TypeError(message)
    TypeError: write() only accepts bytes, unicode, and dict objects

If I understand correctly, the following code tries to call self.write(json_object):

    @web.authenticated
    async def get(self):
        url_params = self.request.uri
        request_data = unquote(url_params[url_params.index('=')+1:])
        response = self.tabnine.request(request_data)
        self.write(response)

However, not all JSON objects are supported by Tornado.RequestHandler.write, and tabnine may return NULL according to its documentation, in which case the code will error out.

Possible fix:

self.write(json.dumps(response))

Follow the install command but failed to work

the error message when running jupyter notebook

404 GET /nbextensions/jupyter-tabnine.js?v=20200415150256 (::1) 44.17ms referer=http://localhost:8888/notebooks/%E6%9C%AA%E5%91%BD%E5%90%8D.ipynb?kernel_name=python3
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
yield gen.maybe_future(handler(stream, idents, msg))
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 579, in complete_request
matches = yield gen.maybe_future(self.do_complete(code, cursor_pos))
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/ipykernel/ipkernel.py", line 354, in do_complete
return self._experimental_do_complete(code, cursor_pos)
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/ipykernel/ipkernel.py", line 379, in _experimental_do_complete
completions = list(_rectify_completions(code, raw_completions))
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/IPython/core/completer.py", line 484, in rectify_completions
completions = list(completions)
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/IPython/core/completer.py", line 1815, in completions
for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/IPython/core/completer.py", line 1859, in _completions
full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column)
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/IPython/core/completer.py", line 1983, in _complete
text = self.splitter.split_line(line_buffer, cursor_pos)
File "/Users/wuyoudong/opt/anaconda3/lib/python3.7/site-packages/IPython/core/completer.py", line 562, in split_line
l = line if cursor_pos is None else line[:cursor_pos]
TypeError: 'NoneType' object is not subscriptable

also if I enter
jupyter nbextension list

it shows

jupyter-tabnine enabled

  • Validating: problems found:
    - require? X jupyter-tabnine

pls help, thanks.

Docker image

Please check for Dockerized build. Facing multiple issues while creating image and also while docker run.

Can't escape dropdown menu w/o selecting a completion.

Using TabNine with Jupyter. Let's say I see a completion that seems relevant to me at first glance. I scroll down but as I'm doing so I realize this isn't what I was looking for. Now I have to select something, erase it and continue. Doesn't sound like a big deal but when this happens several times it gets annoying.

escdoesntwork.zip

Autocompletion does not work and no suggestions pop up

OS: Windows 10 X64 Enterprise
Python interpreter: Python 3.7.5 (Anaconda)
Jupyter version:

jupyter core     : 4.6.1
jupyter-notebook : 6.0.2
qtconsole        : 4.6.0
ipython          : 7.10.2
ipykernel        : 5.1.3
jupyter client   : 5.3.4
jupyter lab      : not installed
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.3

Description:
After following the instructions to install and enable the extension, in the notebook the extension simply does not work (no suggestion list).
I used the debug mode to check the error message, and this is what I have after opening a notebook and typing a letter to trigger the autocompletion:

[E 12:33:11.390 NotebookApp] Uncaught exception GET /tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22...
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22...', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "path-to-anaconda3\envs\general\lib\site-packages\tornado\web.py", line 1699, in _execute
        result = await result
      File "path-to-anaconda3\envs\general\lib\site-packages\jupyter_tabnine-1.0.2-py3.7.egg\jupyter_tabnine\handler.py", line 13, in get
        response = self.tabnine.request(request_data)
      File "path-to-anaconda3\envs\general\lib\site-packages\jupyter_tabnine-1.0.2-py3.7.egg\jupyter_tabnine\tabnine.py", line 76, in request
        proc = self._get_running_tabnine()
      File "path-to-anaconda3\envs\general\lib\site-packages\jupyter_tabnine-1.0.2-py3.7.egg\jupyter_tabnine\tabnine.py", line 115, in _get_running_tabnine
        self._restart()
      File "path-to-anaconda3\envs\general\lib\site-packages\jupyter_tabnine-1.0.2-py3.7.egg\jupyter_tabnine\tabnine.py", line 110, in _restart
        stderr=subprocess.DEVNULL,
      File "path-to-anaconda3\envs\general\lib\subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "path-to-anaconda3\envs\general\lib\subprocess.py", line 1207, in _execute_child
        startupinfo)
    OSError: [WinError 193] %1 is not a valid Win32 application
[D 12:33:11.393 NotebookApp] Using contents: services/contents
[D 12:33:11.395 NotebookApp] Using contents: services/contents
[E 12:33:11.400 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Accept": "*/*",
      "X-Requested-With": "XMLHttpRequest",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-Mode": "cors",
      "Referer": "http://localhost:8888/notebooks/notebooks/Untitled.ipynb",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9",
      "Cookie": "_xsrf=2|68c99bb7|08b968eee94d37a6553c5c0309a7f367|1577123162; username-localhost-8888=\"2|1:0|10:1579519975|23:username-localhost-8888|44:NjM5Njc4NTcxNjA2NDEzMzhmMWE1NjMxOTdiMWQ2ODU=|67ed429e0eba414629080875a41de944d2561cf2da4333ad5a5e214b7e43b304\""
    }

As stated in the error OSError: [WinError 193] %1 is not a valid Win32 application, I checked the binaries of TabNine and found that TabNine.exe indeed could not be run directly, but I am not sure whether this is the problem.
To add to the problem, I am using a company laptop with non-admin user access, but I installed with the --user flag which shall be fine.

JupyterLab

Any chance we can get this working in JupyterLab?

INFO on the terminal after installation

After installation, I restarted three times, but I still get the following INFO.
Is there any way to remove this?

[INFO 2020-02-10 07:14:56.509 TabNine]:  install dir: /Users/shinokada/virtualenvs/jupyter/lib/python3.7/site-packages/jupyter_tabnine
[INFO 2020-02-10 07:14:56.510 TabNine]: TabNine binary already exists in /Users/shinokada/virtualenvs/jupyter/lib/python3.7/site-packages/jupyter_tabnine/binaries/2.2.2/x86_64-apple-darwin/TabNine ignore downloading

image

Jupyter TabNine not working after installation

Hi,

I just installed the extension using pip3 and following all the steps properly (and have the lastest version of Jupyter).

The extensions shows up in the nbextension and is enabled. But when I type, the autocomplete feature is not working.

Don't know what would be the best steps?

Thanks in advance!

Change the Tab colour

Hello, i'm using a theme in Juyter, so when i use the TabNine the text is unreadable, can you tell me how can i change the colour of the background of the popup?

image

Tabnine占据上G的内存(Takes up too much memory)

如图所示,仅仅开一个jupyter文件几秒钟,瞬间占据1.8G内存。(As shown below, after opening just one jupyter file, tabnine takes up almost 1.8G memory, which also increases the Windows virtual memory dramatically)

image

How to remove tabnine from Jupyter notebook?

I'm not able to remove tabnine from jupyter notebook. Did pip3 uninstall jupyter-tabnine. It uninstalled the package but "Jupyter Tabnine" is still showing under the Help dropdown list in notebook. Kindly help.

Cannot install Tabnine in conda environment (Python=3.7.5), Ubuntu 18.04, zsh shell

I would love to use and subscribe to tabnine. In this case I wanted to start using it in a Jupyter Notebook so I activated a freshly made conda environment then did the following inside it:

  1. pip3 install jupyter-tabnine (installs a bunch of things and finishes ok)
  2. RUN jupyter nbextension install --py jupyter_tabnine
  3. RUN jupyter nbextension enable --py jupyter_tabnine
  4. RUN jupyter serverextension enable --py jupyter_tabnine
    ......(1,2,3,4) runs ok but when I start a new jupyter notebook....I don't see any auto-completions or suggestions.

If I drop the "RUN" statement from (2,3,4) I get the following errors

  1. jupyter nbextension install --py jupyter_tabnine

Installing /home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/jupyter_tabnine/static -> jupyter_tabnine
Traceback (most recent call last):
File "/home/alministrator/anaconda3/envs/mbo/bin/jupyter-nbextension", line 11, in
sys.exit(main())
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/jupyter_core/application.py", line 268, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
app.start()
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/notebook/nbextensions.py", line 983, in start
super(NBExtensionApp, self).start()
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/jupyter_core/application.py", line 257, in start
self.subapp.start()
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/notebook/nbextensions.py", line 711, in start
self.install_extensions()
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/notebook/nbextensions.py", line 690, in install_extensions
**kwargs
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/notebook/nbextensions.py", line 220, in install_nbextension_python
destination=dest, logger=logger
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/notebook/nbextensions.py", line 121, in install_nbextension
ensure_dir_exists(nbext)
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/site-packages/jupyter_core/utils/init.py", line 13, in ensure_dir_exists
os.makedirs(path, mode=mode)
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/home/alministrator/anaconda3/envs/mbo/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter'

====
3) jupyter nbextension enable --py jupyter_tabnine

Enabling notebook extension jupyter_tabnine/main...
- Validating: problems found:
- require? X jupyter_tabnine/main

  1. jupyter serverextension enable --py jupyter_tabnine

Enabling: jupyter_tabnine

  • Writing config: /home/alministrator/.jupyter
    • Validating...
      jupyter_tabnine OK

....I don't see anything active when I then startup jupyter notebook and try something....

No connection to internal server in console, error 500, Jupyter-Tabnine not working on Mac Chrome, Python3

Here is my Chrome output. I am using jupyter notebook , Python 3 and MacosX Catalina.

Loading extension: contrib_nbextensions_help_item/main
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:34748 Loading extension: execute_time/ExecuteTime
ExecuteTime.js?v=20200217233217:55 [ExecuteTime] patching CodeCell.prototype.get_callbacks
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:34748 Loading extension: jupyter_tabnine/main
main.js?v=20200217233217:519 [nbextensions/jupyter_tabnine/main] continuous autocompletion on
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:34748 Loading extension: toc2/main
main.js?v=20200217233217:188 [toc2] Notebook fully loaded -- toc2 initialized
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:47784 Kernel: kernel_connected (e961c3f7-9b2d-48bf-a2eb-5e481158e013)
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:47784 Kernel: kernel_ready (e961c3f7-9b2d-48bf-a2eb-5e481158e013)
main.js?v=20200217233217:482 [nbextensions/jupyter_tabnine/main] new base completer
main.js?v=20200217233217:487 [nbextensions/jupyter_tabnine/main] new deep completer
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:46439 Object
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:46439 Object
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:46439 Object
main.min.js?v=fd76f62c63dfcfdb33c73b0d15290316:46439 Object
main.js?v=20200217233217:504 [nbextensions/jupyter_tabnine/main] call deep completer....
:8888/tabnine?data=%7B%22version%22%3A%221.0.7%22%2C%22request%22%3A%7B%22Autocomplete%22%3A%7B%22filename%22%3A%22Jupyter%2Fmisc%2FExcelWr.py%22%2C%22before%22%3A%22%23If%20passing%20an%20existing%20ExcelWriter%20object%2C%20then%20the%20sheet%20will%20be%20added%20to%20the%20existing%20workbook.%20This%20can%20be%20used%20to%20%23save%20different%20DataFrames%20to%20one%20workbook%3A%5Cn%23%3E%20writer%20%3D%20pd.ExcelWriter(%27output.xlsx%27)%5Cn%23%3E%20df1.to_excel(writer%2C%27Sheet1%27)%5Cn%23%3E%20df2.to_excel(writer%2C%27Sheet2%27)%5Cn%23%3E%20writer.save()%5Cnimport%20pandas%20%22%2C%22after%22%3A%22%5Cnwriter%20%3D%20pd.ExcelWriter(%2713_14.xlsx%27%2C%20engine%3D%27xlsxwriter%27)%5Cnwriter.save()%5Cnimport%20pandas%20as%20pd%5Cn%23%20dataframe%20Name%20and%20Age%20columns%5Cnpd.read_csv(%27%2FUsers%2Fnicholasphillips%2FDesktop%2FND%2Fbase_data%2F2014_2013.csv%27)%5Cn%23%20Create%20a%20Pandas%20Excel%20writer%20using%20XlsxWriter%20as%20the%20engine.%5Cn%23%23writer%20%3D%20pd.ExcelWriter(%2713_14.xlsx%27%2C%20engine%3D%27xlsxwriter%27)%5Cn%23%20Convert%20the%20dataframe%20to%20an%20XlsxWriter%20Excel%20object.%5Cn%23df.to_excel(writer%2C%20sheet_name%3D%27Sheet1%27%2C%20index%3DFalse)%5Cn%23%20Close%20the%20Pandas%20Excel%20writer%20and%20output%20the%20Excel%20file.%5Cn%23writer.save()%5Cndf1%20%3D%20pd.read_csv(%27%2FUsers%2Fnicholasphillips%2FDesktop%2FND%2Fbase_data%2F2014_2013.csv%27)%5Cnwriter%20%3D%20pd.ExcelWriter(%2713_14.xlsx%27%2C%20engine%3D%27xlsxwriter%27)%5Cndf1.to_excel(writer%2C%20sheet_name%3D%2713_14%27%2C%20index%3DFalse)%5Cnwriter.save()%22%2C%22region_includes_beginning%22%3Atrue%2C%22region_includes_end%22%3Atrue%2C%22max_num_results%22%3A10%7D%7D%7D:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
main.js?v=20200217233217:123 [nbextensions/jupyter_tabnine/main] get error: Object
2main.js?v=20200217233217:147 [nbextensions/jupyter_tabnine/main] complete is visible, ignore by just return
DevTools failed to parse SourceMap: http://localhost:8888/static/notebook/js/main.min.js.map`

jupyter-tabnine doesnt work at all after installation

I followed instruction but failed. Everything seems to be installed pretty well (I see it nbextension menu enabled), but doesn't work at all, in addition it broke old default autocompletion, but started to work afain after disabling this extension. What can I do to make it work?

Below info that I did:

!jupyter nbextension install --py jupyter_tabnine
!jupyter nbextension enable --py jupyter_tabnine
!jupyter serverextension enable --py jupyter_tabnine
Installing C:\Anaconda3\lib\site-packages\jupyter_tabnine\static -> jupyter_tabnine
Up to date: C:\ProgramData\jupyter\nbextensions\jupyter_tabnine\main.css
Up to date: C:\ProgramData\jupyter\nbextensions\jupyter_tabnine\main.js
Up to date: C:\ProgramData\jupyter\nbextensions\jupyter_tabnine\README.md
Up to date: C:\ProgramData\jupyter\nbextensions\jupyter_tabnine\tabnine.yaml
- Validating: ok

    To initialize this nbextension in the browser every time the notebook (or other app) loads:
    
          jupyter nbextension enable jupyter_tabnine --py
    
Enabling notebook extension jupyter_tabnine/main...
     - Validating: ok
Enabling: jupyter_tabnine
- Writing config: C:\Users\ashrapov-ir\.jupyter
    - Validating...
      jupyter_tabnine  ok

!pip list
Package Version


absl-py 0.6.1
alabaster 0.7.10
albumentations 0.3.0
altair 2.3.0
anaconda-client 1.6.3
anaconda-navigator 1.6.2
anaconda-project 0.6.0
asn1crypto 0.22.0
astor 0.7.1
astroid 1.4.9
astropy 1.3.2
atomicwrites 1.3.0
attrs 19.1.0
automl 2.9.9
Babel 2.4.0
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4 4.6.0
bitarray 0.8.1
blaze 0.10.1
bleach 1.5.0
bokeh 0.12.5
boto 2.46.1
boto3 1.9.80
botocore 1.12.80
Bottleneck 1.2.1
bz2file 0.98
certifi 2019.6.16
cffi 1.10.0
chardet 3.0.3
Click 7.0
cloudpickle 0.2.2
clyent 1.2.2
colorama 0.4.1
comtypes 1.1.2
conda 4.3.21
contextlib2 0.5.5
cryptography 1.8.1
cx-Oracle 7.0.0
cycler 0.10.0
Cython 0.25.2
cytoolz 0.8.2
dask 1.0.0
datashape 0.5.4
deap 1.2.2
decorator 4.0.11
dill 0.2.8.2
distributed 1.16.3
docutils 0.13.1
efficientnet 0.0.3
entrypoints 0.2.2
et-xmlfile 1.0.1
fastcache 1.0.2
flake8 3.6.0
Flask 0.12.2
Flask-Cors 3.0.2
funcy 1.12
future 0.17.1
gast 0.2.0
gensim 3.6.0
gevent 1.2.1
greenlet 0.4.12
grpcio 1.18.0
h5py 2.7.0
HeapDict 1.0.0
html5lib 0.999
hyperopt 0.1.1
idna 2.5
image-classifiers 0.2.0
imagecodecs 2018.12.1
imagesize 0.7.1
imgaug 0.2.6
importlib-metadata 0.19
ipykernel 4.6.1
ipython 5.3.0
ipython-genutils 0.2.0
ipywidgets 6.0.0
isort 4.2.5
itsdangerous 0.24
jdcal 1.3
jedi 0.10.2
Jinja2 2.9.6
jmespath 0.9.3
joblib 0.13.0
jsonschema 2.6.0
jupyter 1.0.0
jupyter-client 5.0.1
jupyter-console 5.1.0
jupyter-contrib-core 0.3.3
jupyter-contrib-nbextensions 0.5.1
jupyter-core 4.3.0
jupyter-highlight-selected-word 0.2.0
jupyter-latex-envs 1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyter-tabnine 1.0.2
Keras 2.2.4
Keras-Applications 1.0.7
Keras-Preprocessing 1.0.5
keras-tqdm 2.0.1
kito 1.0.0
labelme 3.6.16
lazy-object-proxy 1.2.2
lightgbm 2.0.12
llvmlite 0.18.0
locket 0.2.0
logdecorator 2.1
lunardate 0.2.0
lxml 3.7.3
Markdown 3.0.1
MarkupSafe 0.23
matplotlib 2.0.2
mccabe 0.6.1
menuinst 1.4.7
mistune 0.7.4
more-itertools 7.2.0
mpmath 0.19
msgpack-python 0.4.8
multipledispatch 0.4.9
multiprocess 0.70.6.1
navigator-updater 0.1.0
nbconvert 5.1.1
nbformat 4.3.0
networkx 1.11
nltk 3.2.3
nose 1.3.7
notebook 5.0.0
numba 0.33.0
numexpr 2.6.2
numpy 1.16.2
numpydoc 0.6.0
odo 0.5.0
olefile 0.44
opencv-python 4.0.0.21
openpyxl 2.4.7
packaging 19.1
pandas 0.25.1
pandocfilters 1.4.1
partd 0.3.8
path.py 10.3.1
pathlib2 2.2.1
pathos 0.2.2.1
patsy 0.4.1
pep8 1.7.0
pickleshare 0.7.4
pigar 0.9.2
Pillow 5.3.0
pip 18.1
pluggy 0.12.0
ply 3.10
pox 0.2.4
ppft 1.6.4.8
prompt-toolkit 1.0.14
prophet 0.1.1
protobuf 3.6.1
psutil 5.2.2
py 1.8.0
pycodestyle 2.4.0
pycosat 0.6.2
pycparser 2.17
pycrypto 2.6.1
pycurl 7.43.0
pyflakes 2.0.0
Pygments 2.2.0
pylint 1.6.4
pymongo 3.7.2
pymystem3 0.2.0
pyodbc 4.0.16
pyOpenSSL 17.0.0
pypandoc 1.4
pyparsing 2.4.2
pyreadline 2.1
pystan 2.18.0.0
pytest 5.0.1
python-dateutil 2.7.5
pytz 2017.2
PyWavelets 0.5.2
pywin32 220
PyYAML 3.12
pyzmq 16.0.2
QtAwesome 0.4.4
qtconsole 4.3.0
QtPy 1.2.1
requests 2.22.0
rope-py3k 0.9.4.post1
s3transfer 0.1.13
scikit-image 0.14.2
scikit-learn 0.18.1
scipy 1.2.0
seaborn 0.7.1
segmentation-models 0.2.1
setuptools 40.6.3
shap 0.28.5
Shapely 1.6.4.post1
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.12.0
sklearn-deap2 0.2.2
smart-open 1.7.1
snowballstemmer 1.2.1
sortedcollections 0.5.3
sortedcontainers 1.5.7
Sphinx 2.1.2
sphinxcontrib-applehelp 1.0.1
sphinxcontrib-devhelp 1.0.1
sphinxcontrib-htmlhelp 1.0.2
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.2
sphinxcontrib-serializinghtml 1.1.3
spyder 3.1.4
SQLAlchemy 1.1.9
statsmodels 0.8.0
sympy 1.0
tables 3.2.2
tabulate 0.8.2
tblib 1.3.2
tensorboard 1.12.1
tensorflow-gpu 1.12.0
termcolor 1.1.0
testpath 0.3
tifffile 2018.11.28
toolz 0.8.2
tornado 4.4.3
tqdm 4.29.0
traitlets 4.3.2
transliterate 1.10.2
tta-wrapper 0.0.1
unicodecsv 0.14.1
urllib3 1.24.1
vega-datasets 0.7.0
virtualenv 16.2.0
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.12.2
wheel 0.32.3
widgetsnbextension 2.0.0
win-unicode-console 0.5
wrapt 1.10.10
xgboost 0.82
xlrd 1.1.0
XlsxWriter 0.9.6
xlwings 0.10.4
xlwt 1.2.0
zict 0.1.2
zipp 0.5.2

Shift+Space doesn't seem to work

I have remote jupyter notebook server.
I've setup on it docker with jupyter as were in earlier versions shown, then installed latest available library from github. At first it wouldn't even show me predictions, even after i entered correct address of the server in the nbextensions settings , i had to manually enter server http://*ip*:9999 into .js file (in var config), then it worked.
But still, when i press Shift+Space it doesn't show original jupyter popup with function suggestions. Any help appreciated, as i'm huge fan of tabnine, but it's very uncomfortable to guess what functions i have in the library.

Tabnine suggestions don't work in non-code cells

Hi I am editing a markdown document and I was expecting the tabnine autocompletion to work for markdown cells, unfortunately it does not. I can although get this to work by switching the cells to Code type though some of the formatting breaks. TabNine for vim can work for any kind of document, could this perhaps be made to work in non-code cells? I am using the jupytext extension which turns any .md file into an executable .ipynb when editing.

tabnine change font in jupyter

Hi,
I am using dark mode in jupyther and the font for TabNine suggestions is hard to read. Is there an easy way to change it?
thanks

不能正常显示提示

问题描述

按说明安装启用插件后,未显示 tabnine 智能提示

问题类型

bug

环境:win10

image

问题详情

安装启用完毕

image
image

输入代码import numpy as np, import tensorflow as tf,未获得提示,tab 键失效,server 上看似乎是远程读取失败

image

换用 hinterland 时表现正常

image

How do I install this with Anaconda?

Hello, I'm using Anaconda. Can't seem to install it with: pip3 install jupyter-tabnine [--user][--upgrade]

Throws out this error:

ERROR: Exception:
Traceback (most recent call last):
File "e:\anaconda\lib\site-packages\pip_vendor\packaging\requirements.py", line 93, in init
req = REQUIREMENT.parseString(requirement_string)
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 1939, in parseString
raise exc
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 1929, in parseString
loc, tokens = self._parse(instring, 0)
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 1669, in _parseNoCache
loc, tokens = self.parseImpl(instring, preloc, doActions)
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 4037, in parseImpl
loc, exprtokens = e._parse(instring, loc, doActions)
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 1673, in _parseNoCache
loc, tokens = self.parseImpl(instring, preloc, doActions)
File "e:\anaconda\lib\site-packages\pip_vendor\pyparsing.py", line 3783, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd, found '[' (at char 11), (line:1, col:12)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "e:\anaconda\lib\site-packages\pip_internal\cli\base_command.py", line 153, in _main
status = self.run(options, args)
File "e:\anaconda\lib\site-packages\pip_internal\commands\install.py", line 362, in run
wheel_cache
File "e:\anaconda\lib\site-packages\pip_internal\cli\req_command.py", line 238, in populate_requirement_set
wheel_cache=wheel_cache
File "e:\anaconda\lib\site-packages\pip_internal\req\constructors.py", line 395, in install_req_from_line
parts = parse_req_from_line(name, line_source)
File "e:\anaconda\lib\site-packages\pip_internal\req\constructors.py", line 347, in parse_req_from_line
extras = convert_extras(extras_as_string)
File "e:\anaconda\lib\site-packages\pip_internal\req\constructors.py", line 78, in convert_extras
return Requirement("placeholder" + extras.lower()).extras
File "e:\anaconda\lib\site-packages\pip_vendor\packaging\requirements.py", line 97, in init
requirement_string[e.loc : e.loc + 8], e.msg
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'[--upgra'": Expected stringEnd

or python3 setup.py install... doesn't say anything in the command prompt. I'm using Anaconda cmd for installation. It doesn't work with Windows cmd either. Thank you for your help.

Not working on notebooks that have images in markdowns

I was working on a homework notebook, where the notebook had markdowns with images, notes, etc. Although the semantic completer was enabled, I was not able to see any tab opening for completion while writing with/without pressing tab. Then I have copied the notebook and deleted all markdowns and the completion came back. I wish you could solve the problem since I prepare and also work on many notebooks with graphical content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.