I use the low-level Python shell in OS X (El Capitan) and every time I send a piece of code to a Python process (using Cc Cr , which is associated with python-shell-send-region ), I get a similar message in the Python shell:
>>> import codecs, os; __pyfile = codecs.open('''/var/folders/6j/g9hcs1s17g1dgxr3p_m04rq80000gn/T/py5013kfY''', encoding='''utf-8'''); __code = __pyfile.read().encode('''utf-8'''); __pyfile.close(); os.remove('''/var/folders/6j/g9hcs1s17g1dgxr3p_m04rq80000gn/T/py5013kfY'''); exec(compile(__code, '''/Users/user/Desktop/sample.py''', 'exec'));
I would not want this message to appear every time the command is called. The same version of Emacs for Linux (along with the python.el file) does not have this problem. The message template is defined in the python-shell-send-file function (in the python.el file), which in itself is bewildering, since I cannot understand how this function is called when python-shell-send-region called. For the first run, I invoke the Python interpreter (version 2.7.10) with the following command
/usr/bin/python -i
but it also behaves the same with other python interpreters (installed via brew). I am using Emacs 24.5.1 (installed again through Brew). The only Python mode specific configuration I use in .emacs is related to the width of the tab:
(add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t) (setq tab-width 2) (setq python-indent 2)))
Any help or suggestion is appreciated.
Change and possible solution :
(I found this https://github.com/jorgenschaefer/elpy/issues/1307 ):
$ easy_install-3.6 gnureadline $ cd /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload $ mv readline.cpython-36m-darwin.so readline.cpython-36m-darwin.so.bak
If you get an error while installing gnureadline, fatal error: 'stdio.h' file not found , try xcode-select --install .
s.yadegari
source share