Skip to content
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

incompatibility with iPython 5.0 #7

Open
topisani opened this issue Jul 19, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@topisani
Copy link

commented Jul 19, 2016

Some of that strongly disagrees with sage-shell mode!
The repl buffer is not read-only, and nothing happens when i press enter or run sage-shell:send-input manually. ob-sagemath is also broken, but i assume its happening over here

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Jul 19, 2016

I built the latest Sage from the source by using the develop branch of the Sage source repository.
It seems that the latest Sage uses IPython 4.2.1.
And sage-shell-mode and ob-sagemath work properly for me.

Here is an output of sage --version.

    SageMath version 7.3.beta8, Release Date: 2016-07-14

And that of sage --ipython.

    Python 2.7.10 (default, Jul 20 2016, 07:51:14) 
    Type "copyright", "credits" or "license" for more information.

    IPython 4.2.1 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.

Is Sage properly installed?
If you have an error when using sage-shell-mode, could you provide me the error message?

@topisani

This comment has been minimized.

Copy link
Author

commented Jul 20, 2016

i downgraded sage to 7.2-6, and ipython to 4.2.0. Sage worked fine with ipython 5.0, but sage-shell-mode had some issue, and i didnt get any error message. The fact that sage 7.2-7 didnt work with ipython 4.2 may have been some mistake on my end. Point is, i seem to have narrowed it down to sage-shell-mode not working well with ipython 5.0, and ill just stay away from that update for now.

Totally unrelated:
Thanks a lot for this plugin, its gotten me one step closer to not having to install windows again when i go back to school in a month!

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Jul 20, 2016

I do not quite understand about "Sage worked fine with ipython 5.0". If I understand correctly, Sage provides ipython and its version is less than 5.0. How do you use Sage with ipython 5.0?

I do not understand the version number 7.2-7 either. The version number of Sage corresponds to a tag of the git repository. And recent tags are 7.2, 7.2.beta0, ..., 7.2.beta5, 7.3.beta0, ... and 7.3.beta8. What does the number 7.2-7 mean?

Also, does Sage work fine in the command line without Emacs?

Totally unrelated:
Thanks a lot for this plugin, its gotten me one step closer to not having to install windows again when i go back to school in a month!

You are welcome!

@topisani

This comment has been minimized.

Copy link
Author

commented Jul 20, 2016

ah! i am on arch linux, and that is the sage version in their repositories, i just made the assumption that they were global sage version numbers, but they are probably not then. As for ipython, that was installed as a dependency by the package manager, and aparently not provided by sage, but that might be the underlying issue, sage shouldnt be using ipython 5.0 anyway.

So, since anything i type comes out confusing as hell, here is what i did:

  • installed sage (7.2-6) using the package manager (which brought along ipython 4.2 as a dependency)
  • set it up in emacs - worked great
  • ran the package manager's update command, which updated ipython to 5.0 and sage to whatever it is the arch repos call 7.2-7
  • tried it in emacs, the REPL was broken, and ob-sagemath blocks hung forever.
  • tried it in the terminal, no issues
  • downgraded ipython to 4.2 and sage to 7.2-6 (yep, i know that version makes no sense, but it shouldnt be important)
  • now it works great everywhere.

I dont believe the sage version is the issue, only ipython 5.0. But maybe the arch repos should have them as two different packages (ipython4 & ipython5)? anyway ill keep it downgraded for now, but since sage itself appears to work fine with ipython 5.0, im guessing its an issue on your end.

conclusion:
sage-shell-mode doesnt work with ipython 5.0, and i dont know if it is supposed to.

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Jul 20, 2016

Thank you for the explanation. Now I understand your issue.

It seems very strange to me because sage-shell-mode does not depend on system-wide installed ipython and if Sage works fine in the terminal, then sage-shell-mode should also do.
Actually I installed ipython 5.0.0 with sudo pip install ipython, but sage-shell-mode works properly (I use Ubuntu 16.04).

I will install arch linux and take look into the issue. Thanks for the report.

@topisani topisani changed the title iPython 5.0 and sage 7.2-7 incompatibility with iPython 5.0 on Arch linux Jul 20, 2016

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Jul 21, 2016

sage-shell-mode in arch linux is broken because they merged this branch and Emacs's inferior shell does not work well with ipython 5.0 (see this document of ipython).

To avoid this problem, ipython 5.0 provides --simple-prompt option. But Sage does not have this option.

Sage with ipython 5.0 doesn't work in shell-mode, comint-mode or eshell. But it works fine in term-mode. So I will investigate term-mode.

Even if this problem is solved, sage-shell-mode (and ob-sagemath) do not work well with ipython 5.0, because run_cell is broken in ipython 5.0 and sage-shell-mode uses it.

@topisani

This comment has been minimized.

Copy link
Author

commented Aug 8, 2016

the arch repos recently upgraded to sage 7.3, and it still doesnt work with ipython 4.2. I will try building from source

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Aug 8, 2016

Thanks for reporting.

it still doesnt work with ipython 4.2

You mean ipython 5.0?

The master branch of the Sage repository uses the old prompt of ipython. So currently this problem does not happen if you build it from source. Actually, I use Sage 7.3 with sage-shell-mode on Ubuntu and it works fine.

To fix this bug, sage-shell-mode must treat some of escape sequences. I will implement it. Sorry for taking long time.

@topisani

This comment has been minimized.

Copy link
Author

commented Aug 8, 2016

sorry, what i meant was, the 7.3 version of sage in the arch repos, doesn't work with ipython 4.2. It requires 5.0

Didnt mean to rush you, just wanted to report, that to get sage working on arch with sage-shell-mode you still have to build from source, even with the new version of sage.

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Aug 10, 2016

Did you have any issues building sage from source on arch?

@topisani, I can successfully build Sage on arch as follows.

sudo pacman -S gcc-fortran perl
git clone https://github.com/sagemath/sage.git
cd sage
make distclean # You may need this if you previously had an error.
make
./sage # Sage runs successfully.

If you still have an error when building, please ask at https://groups.google.com/forum/#!forum/sage-support

@topisani

This comment has been minimized.

Copy link
Author

commented Aug 10, 2016

i was downloading the source from the website directly, the latest git version helped. Thanks a lot!

stakemori added a commit that referenced this issue Sep 3, 2016

@stakemori

This comment has been minimized.

Copy link
Collaborator

commented Sep 4, 2016

This issue was (almost) fixed, though there still exists a minor problem.

To use sage-shell-mode with IPython 5, you need to install Emacs 24.4 or later and
set sage-shell:use-prompt-toolkit to t.
ob-sagemath also works well.

I found at least one problem.
We can input multiple lines. But we cannot change indent level when inputting multiple lines.
It is due to an issue of IPython .

So I keep this issue open for a while. Thanks for reporting.

@stakemori stakemori changed the title incompatibility with iPython 5.0 on Arch linux incompatibility with iPython 5.0 Sep 4, 2016

@stakemori stakemori added the bug label Sep 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.