Closed n-WN closed 5 months ago
Thank you for reporting this. We did test 10.3 in the presence of older versions of SageMath, including 10.1, but we did not see anything like this. Of course, based on your earlier question you were expecting this. I am assuming that this has to do with PyPI packages that you installed with SageMath 10.1. Can you please try this:
$ mv ~/.sage ~/DOT_SAGE $ sage
(You can always move it back later.)
Please report what happens. If this works, maybe we can figure out what needs to be updated in your ~/.sage directory.
I don't know of anything (other than /usr/local/bin/sage) that would be overwritten by installing SageMath 10.3. When you say that something was overwriteen, what are you referring to?
Looking at your traceback makes me suspect that SageMath-10.3 is crashing when it imports something from an IPython package installed in your ~/.sage directory. Can you check whether you have IPython installed in ~/.sage? If so, is there a reason why you need that?
Looking at your traceback makes me suspect that SageMath-10.3 is crashing when it imports something from an IPython package installed in your ~/.sage directory. Can you check whether you have IPython installed in ~/.sage? If so, is there a reason why you need that?
cd ~/.sage/ && ls
R db ipython-5.0.0 local maxima temp
cache gap jupyter-4.1 matplotlib-1.5.1 pycache
There is indeed Ipython. I forgot why I installed it in the first place. Maybe I felt that the terminal interaction of sage is very similar to that of ipython. I wanted to test the difference between the installation and the installation.
SageMath 10.3 includes IPython 8.18.1. It looks like you might have a copy of 5.0.0 installed in your ~/.sage directory. (The actual installation would be in ~/.sage/local/lib/python3.11/site-packages)
Did it help to temporarily move ~/.sage out of the way?
SageMath 10.3 includes IPython 8.18.1. It looks like you might have a copy of 5.0.0 installed in your ~/.sage directory. (The actual installation would be in ~/.sage/local/lib/python3.11/site-packages)
Did it help to temporarily move ~/.sage out of the way?
It worked out. Thank you
cp -r .sage/ sageBackup/
rm -rf .sage/
cd sageBackup/
ls
R db ipython-5.0.0 local maxima temp
cache gap jupyter-4.1 matplotlib-1.5.1 pycache
sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.3, Release Date: 2024-03-19 │
│ Using Python 3.11.1. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: GF(9)
Finite Field in z2 of size 3^2
SageMath 10.3 includes IPython 8.18.1. It looks like you might have a copy of 5.0.0 installed in your ~/.sage directory. (The actual installation would be in ~/.sage/local/lib/python3.11/site-packages)
Did it help to temporarily move ~/.sage out of the way?
But I don’t know how to uninstall the previous version gracefully, rm -rf /var/tmp/sage-10.1-current
? Then use jupyter kernelspec list
to check and remove 10.1?
1) Drag SageMath-10-1.app from /Applications to Trash.
That will trigger Apple's update of their database of installed apps.
2) rm -rf ~/Library/Application\ Support/SageMath
That removes settings and Jupyter runtime files for old versions.
3) sudo rm -rf /usr/local/share/jupyter/kernels/SageMath-10.1
That removes the jupyter kernel spec directory for SageMath 10.1 so it won't appear as a (broken) kernel option in your jupyter notebooks.
You will have to decide what to do about ~/.sage. You could just remove it and install new PyPI packages as needed, but you said you wanted to preserve some of those.
- Drag SageMath-10-1.app from /Applications to Trash. That will trigger Apple's update of their database of installed apps.
rm -rf ~/Library/Application\ Support/SageMath
That removes settings and Jupyter runtime files for old versions.sudo rm -rf /usr/local/share/jupyter/kernels/SageMath-10.1
That removes the jupyter kernel spec directory for SageMath 10.1 so it won't appear as a (broken) kernel option in your jupyter notebooks.You will have to decide what to do about ~/.sage. You could just remove it and install new PyPI packages as needed, but you said you wanted to preserve some of those.
I have followed the three steps you mentioned and solved my previous dilemma very smoothly. Thank you very much.
As for ~/.sage, I decided to completely delete the backup and reinstall it.
There is another point I am not clear about: Why can the (Sagemath) jupyter kernel under Mac easily switch in the ipynb file of vscode, but win cannot? I am trying to make some Sagemath plug-ins, and found that if win users want to open nootbook in a non-browser, they always need to Open the browser version, then paste the token and url into the ipynb settings of vscode and select "Select other kernels--Add existing jupyter server only";
Although this last question has nothing to do with this issue, I am very concerned about how the technology of Sagemath 10.3, which allows you to see the jupyter kernel in the ipynb file of vscode after installation, is implemented
I'm glad that your installation worked out.
I don't know if this will answer your question, but it might help. The jupyter server has a specific list of locations in the filesystem where it looks for kernels. On unix systems, this always includes /usr/local/share/jupyter/kernels. So our extra package installs a Jupyter kernel spec file for the Sage kernel in that directory. It sounds like vscode looks in the same places, but I don't know for sure whether it does. My suggestion would be to start with the Jupyter documentation and see what they say about search paths on Windows.
I'm glad that your installation worked out.
I don't know if this will answer your question, but it might help. The jupyter server has a specific list of locations in the filesystem where it looks for kernels. On unix systems, this always includes /usr/local/share/jupyter/kernels. So our extra package installs a Jupyter kernel spec file for the Sage kernel in that directory. It sounds like vscode looks in the same places, but I don't know for sure whether it does. My suggestion would be to start with the Jupyter documentation and see what they say about search paths on Windows.
I'll go back and look at the files. Thank you!
SageMath 10.3 includes IPython 8.18.1. It looks like you might have a copy of 5.0.0 installed in your ~/.sage directory. (The actual installation would be in ~/.sage/local/lib/python3.11/site-packages)
Did it help to temporarily move ~/.sage out of the way?
After the previous '.sage/' file was deleted, I successfully opened SageMath 10.3, today I was curious to see what was in the '.sage/' directory, but there was really ipython5.0.0, why is that, I installed: pycryptodome, gmpy2;
> cd ~/.sage
> ls -la
total 0
drwx------ 11 lov3 staff 352 Mar 27 02:19 .
drwxr-x---+ 78 lov3 staff 2496 Mar 30 23:45 ..
drwxr-xr-x 3 lov3 staff 96 Mar 26 20:45 R
drwxr-xr-x 3 lov3 staff 96 Mar 30 18:00 cache
drwxr-xr-x 2 lov3 staff 64 Mar 26 20:45 db
drwxr-xr-x 3 lov3 staff 96 Mar 26 20:45 ipython-5.0.0
drwxr-xr-x 3 lov3 staff 96 Mar 27 02:19 local
drwxr-xr-x 2 lov3 staff 64 Mar 26 20:45 matplotlib-1.5.1
drwxr-xr-x 3 lov3 staff 96 Mar 26 21:51 maxima
drwxr-xr-x 4 lov3 staff 128 Mar 27 02:19 pycache
drwxr-xr-x 3 lov3 staff 96 Mar 26 20:45 temp
That is a good question. I think those directories are used for settings files. But I am not sure.
I deleted my .sage directory and restarted the app. I found that I had the same files that you show. The ipython directory is empty. But I cannot explain why it has 5.0.0 when that is not the version of ipython running in Sage. Nor do I know what its purpose is.
In any case, those files do not seem to cause any trouble.