Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "python3" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list. Native completions have been disabled locally.
I only get it in specific cases and I am not sure what is causing it. I am reading some data like this,
# !/usr/bin/env python3 import pickle from variables import objects_address photos = pickle.load(open(objects_address + '2019-10-19 21:18:23.dat', 'rb'))
There is more in this file but in order to narrow the problem I commented all of it. But, the warning persists. After this I do some manipulations to the array of photo objects which
photos is and ask for a
Y/n to save the photos with manipulations using
input(). The program does not halt at this point if I get the warning and it just continues execution. I made this test file,
# !/usr/bin/env python3 import pickle # from geocoder import ip n = [1,2,3] pickle.dump(n, open('TEST.TEST', 'wb')) x = pickle.load(open('TEST.TEST', 'rb')) print(x) name = input('What is your name? ') print('That\'s a nice name, ' + name + '!')
This file runs and acts perfectly fine; takes input and all that. Although, I tried putting
from geocoder import ip in this file and that reproduced the warning. If you add this import to my test file (or even a file with just this one line), we get the same warning.
Here is the output of the test file (with the import that causes the warning):
Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> [1, 2, 3] What is your name? That's a nice name, import codecs, os;__pyfile = codecs.open('''/tmp/py8974PaE''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/tmp/py8974PaE''');exec(compile(__code, '''/tmp/py8974PaE''', 'exec'));!
Here is output without the import that causes the warning (I omitted the version info),
What is your name? Tom That's a nice name, Tom! >>> python.el: native completion setup loaded
Note that in my original file where I read data, I am not importing this geocoder. It was in a neighbouring file where I made the test file and I ran it randomly and realised that it also causes the warning.
I have tried different solutions which people suggested about this warning but non of them worked. I am running
GNU Emacs 25.2.2 on
Ubuntu 18.04.3 LTS
This is my
use-package configurations for elpy in my
;; elpy (use-package elpy :ensure t :defer t :init (elpy-enable) (setq elpy-rpc-python-command "python3") (defun my-python-shell-run () "Run python and pop-up its shell. Kill process to solve the reload modules problem." (interactive) (when (get-buffer-process "*Python*") (set-process-query-on-exit-flag (get-buffer-process "*Python*") nil) (kill-process (get-buffer-process "*Python*")) ;; If you want to clean the buffer too. (kill-buffer "*Python*") ;; Not so fast! (sleep-for 0.5)) (run-python (python-shell-parse-command) nil nil) (python-shell-send-buffer) ;; Pop new window only if shell isnt visible in any frame. (unless (get-buffer-window "*Python*" t) (python-shell-switch-to-shell))) :hook (elpy-mode . (lambda () (highlight-indentation-mode -1) (linum-mode t))) :bind (:map elpy-mode-map ("C-e" . 'elpy-format-code) ("C-w" . 'elpy-pdb-debug-buffer) ("M-w" . 'elpy-pdb-toggle-breakpoint-at-point) ("C-l C-p" . 'elpy-pdb-break-at-point) ("C-c C-c" . 'my-python-shell-run) ("C-h f" .'python-eldoc-at-point) ("M-<backspace>" . (lambda () (interactive) (with-current-buffer (process-buffer (elpy-shell-get-or-create-process)) (comint-clear-buffer))))))