New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues on elpy + emacs 25.1.50.2 + docker + python3 #935

Open
zhihuiFan opened this Issue Jul 17, 2016 · 10 comments

Comments

Projects
None yet
4 participants
@zhihuiFan

zhihuiFan commented Jul 17, 2016

I start to build my development machine with docker several days ago. but I run 2 issues which may the development is not very productive. I think it is easy to reproduce, and you can clone my gitrepo.

The 2 known issues are:

  1. Wrote a 10 lines code, go back to line 5, add a new line after line 5, the code starts looks ugly. this can be fixed by `switch to another buffer and then switch back'
  2. If I use (elpy-use-ipython), I will get some strange code, like ^[[6n^[[JIn [2]: ^[[8D^[[8C^[[8D^[[J^[[6n^[[JIn [2]: ^[[8D^[[8C.

Since I used docker and python3 here, so I am not sure which component is wrong. so I will be thankful if you can take a look at this issue when you get time. if it is not something elpy should fix, I may ask help for other places.

thanks!

@amelio-vazquez-reina

This comment has been minimized.

Show comment
Hide comment
@amelio-vazquez-reina

amelio-vazquez-reina Jul 17, 2016

I am having the same problem when trying to use IPython. That is:

If I run: elpy-use-ipython and then, do C-c C-z on a line in a Python buffer with a simple statement, e.g. a = 2, I see Elpy correctly starting a new buffer with an IPython interpreter but everything looks off:

screen shot 2016-07-17 at 1 04 32 pm

I am running very recent versions of Python, IPython and Emacs:

  • Python 3.5.2 (i.e. the latest Python)
  • IPython 5 (the latest as well, which by the way, recently switched to using https://github.com/jonathanslenders/python-prompt-toolkit as opposed to using pyreadline)
  • GNU Emacs 25.0.95.1 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 Version 10.11.5 (Build 15F34)) of 2016-06-26".

I never used C-c C-z to evaluate Python code myself (I usually use a package called isend-mode to send code to a term buffer), but I wanted to give it a try since I use Elpy for everything else.

Any thoughts on what could be wrong here?

amelio-vazquez-reina commented Jul 17, 2016

I am having the same problem when trying to use IPython. That is:

If I run: elpy-use-ipython and then, do C-c C-z on a line in a Python buffer with a simple statement, e.g. a = 2, I see Elpy correctly starting a new buffer with an IPython interpreter but everything looks off:

screen shot 2016-07-17 at 1 04 32 pm

I am running very recent versions of Python, IPython and Emacs:

  • Python 3.5.2 (i.e. the latest Python)
  • IPython 5 (the latest as well, which by the way, recently switched to using https://github.com/jonathanslenders/python-prompt-toolkit as opposed to using pyreadline)
  • GNU Emacs 25.0.95.1 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 Version 10.11.5 (Build 15F34)) of 2016-06-26".

I never used C-c C-z to evaluate Python code myself (I usually use a package called isend-mode to send code to a term buffer), but I wanted to give it a try since I use Elpy for everything else.

Any thoughts on what could be wrong here?

@jorgenschaefer jorgenschaefer added this to the v1.13 milestone Jul 22, 2016

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jul 22, 2016

Owner

Hello, and thanks for the report! Can you try to add (setenv "IPY_TEST_SIMPLE_PROMPT" "1") to your init file and see if that solves the problem? (See #908 for another report about this)

Owner

jorgenschaefer commented Jul 22, 2016

Hello, and thanks for the report! Can you try to add (setenv "IPY_TEST_SIMPLE_PROMPT" "1") to your init file and see if that solves the problem? (See #908 for another report about this)

@zhihuiFan

This comment has been minimized.

Show comment
Hide comment
@zhihuiFan

zhihuiFan Jul 24, 2016

thanks @jorgenschaefer , the IPY_TEST_SIMPLE_PROMPT fix the one of the issue perfectly. but I still have another issue here.

screenshot from 2016-07-24 07-59-29

at the beginning, I only have 5 line codes. everything is fine. then I switch back to the line 2, then the screen starts to look bad(see line 3 and line 5). you can see it on the attached screen. if I switch to another buffer and switch back, it looks good then.

zhihuiFan commented Jul 24, 2016

thanks @jorgenschaefer , the IPY_TEST_SIMPLE_PROMPT fix the one of the issue perfectly. but I still have another issue here.

screenshot from 2016-07-24 07-59-29

at the beginning, I only have 5 line codes. everything is fine. then I switch back to the line 2, then the screen starts to look bad(see line 3 and line 5). you can see it on the attached screen. if I switch to another buffer and switch back, it looks good then.

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jul 29, 2016

Owner

Sounds like you have some kind of line number mode active, which seems to conflict with one of the minor modes Elpy uses. Try to disable highlight-indentation-mode – does that solve the problem?

Owner

jorgenschaefer commented Jul 29, 2016

Sounds like you have some kind of line number mode active, which seems to conflict with one of the minor modes Elpy uses. Try to disable highlight-indentation-mode – does that solve the problem?

@zhihuiFan

This comment has been minimized.

Show comment
Hide comment
@zhihuiFan

zhihuiFan Jul 30, 2016

I tried that and it doesn't work well. but it is true that there are something wrong with 'line number mode'. here is my configuration.

(setq linum-format "%4d ")
(setq column-number-mode t)
;;(global-linum-mode t)
(highlight-indentation-mode)

Seems I have to remove "global-linum-mode t" to bypass this issue. I really want to show my code with a line number by default all the times.

Do you have any suggestion? Thank you!

zhihuiFan commented Jul 30, 2016

I tried that and it doesn't work well. but it is true that there are something wrong with 'line number mode'. here is my configuration.

(setq linum-format "%4d ")
(setq column-number-mode t)
;;(global-linum-mode t)
(highlight-indentation-mode)

Seems I have to remove "global-linum-mode t" to bypass this issue. I really want to show my code with a line number by default all the times.

Do you have any suggestion? Thank you!

@zhihuiFan

This comment has been minimized.

Show comment
Hide comment
@zhihuiFan

zhihuiFan Jul 31, 2016

Besides the above issue, I also have the following issue sometimes.
I split my screen to left and right. left is my code and right is a shell "python manage.py shell".
some character of right was send to the left screen. See "In [2]" for example.

screen shot 2016-07-31 at 9 22 39 am

zhihuiFan commented Jul 31, 2016

Besides the above issue, I also have the following issue sometimes.
I split my screen to left and right. left is my code and right is a shell "python manage.py shell".
some character of right was send to the left screen. See "In [2]" for example.

screen shot 2016-07-31 at 9 22 39 am

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Aug 5, 2016

Owner

Did you try to disable highlight-indentation-mode as I suggested? You can e.g. customize elpy-modules and remove the relevant module from that list.

The second issue is unrelated, and probably a bug in Emacs.

Owner

jorgenschaefer commented Aug 5, 2016

Did you try to disable highlight-indentation-mode as I suggested? You can e.g. customize elpy-modules and remove the relevant module from that list.

The second issue is unrelated, and probably a bug in Emacs.

@zhihuiFan

This comment has been minimized.

Show comment
Hide comment
@zhihuiFan

zhihuiFan Aug 6, 2016

Thanks @jorgenschaefer , I disabled the module and the issue seems changed but still not resolved.

Disable and save it.
screen shot 2016-08-06 at 5 35 37 pm

then I fond the following lines are added into .emacs
screen shot 2016-08-06 at 5 35 59 pm

But at last:

after I wrote

import datetime
import time

print(datetime.datetime.now())

it looks like this:
screen shot 2016-08-06 at 5 42 01 pm

actually If I tried many times, the output for img #3 are different sometimes.

   1 Elpy Configuration
   2
   3 Virtualenv........: None
   4 RPC Python........: 3.4.3 (/usr/bin/python3)
   5 Interactive Python: ipython (/usr/local/bin/ipython)
   6 Emacs.............: 25.1.50.2
   7 Elpy..............: 1.12.0
   8 Jedi..............: 0.9.0
   9 Rope..............: Not found (0.10.3 available)
  10 Importmagic.......: 0.1.7
  11 Autopep8..........: 1.2.4
  12 Yapf..............: 0.10.0 (0.11.0 available)
  13 Syntax checker....: Not found (flake8)
root@b85873d94f77:~# emacs -version
GNU Emacs 25.1.50.2
Copyright (C) 2016 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

zhihuiFan commented Aug 6, 2016

Thanks @jorgenschaefer , I disabled the module and the issue seems changed but still not resolved.

Disable and save it.
screen shot 2016-08-06 at 5 35 37 pm

then I fond the following lines are added into .emacs
screen shot 2016-08-06 at 5 35 59 pm

But at last:

after I wrote

import datetime
import time

print(datetime.datetime.now())

it looks like this:
screen shot 2016-08-06 at 5 42 01 pm

actually If I tried many times, the output for img #3 are different sometimes.

   1 Elpy Configuration
   2
   3 Virtualenv........: None
   4 RPC Python........: 3.4.3 (/usr/bin/python3)
   5 Interactive Python: ipython (/usr/local/bin/ipython)
   6 Emacs.............: 25.1.50.2
   7 Elpy..............: 1.12.0
   8 Jedi..............: 0.9.0
   9 Rope..............: Not found (0.10.3 available)
  10 Importmagic.......: 0.1.7
  11 Autopep8..........: 1.2.4
  12 Yapf..............: 0.10.0 (0.11.0 available)
  13 Syntax checker....: Not found (flake8)
root@b85873d94f77:~# emacs -version
GNU Emacs 25.1.50.2
Copyright (C) 2016 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
@yitang

This comment has been minimized.

Show comment
Hide comment
@yitang

yitang Aug 11, 2016

the problem is caused by ipython3 5.0, this setting would solve the problem.

(setq python-shell-interpreter "ipython3" python-shell-interpreter-args "--simple-prompt --pprint")

see
http://emacs.stackexchange.com/questions/24750/emacs-freezes-with-ipython-5-0-0
for more details

yitang commented Aug 11, 2016

the problem is caused by ipython3 5.0, this setting would solve the problem.

(setq python-shell-interpreter "ipython3" python-shell-interpreter-args "--simple-prompt --pprint")

see
http://emacs.stackexchange.com/questions/24750/emacs-freezes-with-ipython-5-0-0
for more details

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Aug 12, 2016

Owner

I doubt this is related to ipython, as this is a display in the buffer. (The issue changed mid-discussion.)

Line numbers are tricky in Emacs. Looks like some more modules conflict with linum. You can try nlinum-mode instead of linum-mode. I'm afraid I can't help you there, I never found line numbers useful in Emacs so I never used them.

Owner

jorgenschaefer commented Aug 12, 2016

I doubt this is related to ipython, as this is a display in the buffer. (The issue changed mid-discussion.)

Line numbers are tricky in Emacs. Looks like some more modules conflict with linum. You can try nlinum-mode instead of linum-mode. I'm afraid I can't help you there, I never found line numbers useful in Emacs so I never used them.

@jorgenschaefer jorgenschaefer modified the milestones: v1.13, v1.14 Nov 4, 2016

@jorgenschaefer jorgenschaefer modified the milestones: v1.14, v1.15 Feb 1, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.15, v1.16 May 13, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.16, v1.17 Jul 28, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.17, v1.18 Nov 3, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.18, v1.19 Jan 28, 2018

@jorgenschaefer jorgenschaefer modified the milestones: v1.19, v1.20 Mar 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment