Windows 10: SageMath crashes on start with permission errors, but seems to work if I run "as administrator"
I think I have a workaround, at least, but thought I'd post this in case there's something I can fix or if someone else comes across the same problem, because I couldn't find any mention of these errors myself.
I'm using the Windows installer 0.3 for SageMath 8.1. It appears to install without issues but when I initially opened it I got this sequence of messages:
/etc/profile: line 111: cd: /home/user: Permission denied
WARNING: Failed attempt to cd into /home/user!
mkdir: cannot create directory ‘/home/user/.sagemath-8.1’: Permission denied
cp: cannot create directory '/home/user/.sagemath-8.1': Permission denied
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.1, Release Date: 2017-12-07 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
mkdir: cannot create directory ‘/dot_sage’: Permission denied
/opt/sagemath-8.1/local/lib/python2.7/site-packages/IPython/paths.py:69: UserWarning: IPython parent '/dot_sage' is not a writable location, using a temp directory.
" using a temp directory.".format(parent))
It goes on to say Sage crashed, and asks me to email in the crash report. When I tried opening the shell or Notebook I got similar errors.
Then while groping for something to try I right-clicked and ran "as an administrator" and everything appears to resolve.
I'm not the most savvy at high-level IT stuff but I thought this was strange, as I haven't had to use that feature with anything else I've installed, and there's no shortage of crap I've installed. There's only one account on my computer, there shouldn't be administrator permission issues.
It's difficult exactly to help with something like this without being on the very machine where the problem is. But it sounds likely that there are some permission problems on your home directory; e.g.
C:\Users\<Your Username>
. I'm unsure though because if that were the case I'd think you'd have other problems. If you go to that directory in Windows explorer and right click on it and select "Properties" from the menu you should be able to get to the "Security" tab and check the permissions on the directory...This is a linux machine answering... Which is exactly the location
/home/user
on the Windows box running sage and which are the rights for it?! Is it possible to start in the command line (after Win+R andcmd
) the "sage shell" viasage -sh
and then check viaset SAGE
the settings for the sage specific environment variables?@dan_fulea are you sure you're commenting on the correct question? With apologies, your comment doesn't make much sense to me (to be clear, I'm the creator an present maintainer of the Windows release of Sage so I'm not completely reaching around in the dark here). The problem is definitely that the Windows permissions on the user's directories are messed up somehow.
Sorry, this was an answer without specific knowledge of the situation, i also have no Win* operating system on the many laptops. Starting from the message
i assumed that a linux emulation exists in the windows "run sage" call, which was producing the error. On my machine, i would find and edit
/etc/profile
and give a print of the environment variables, and of the/home/user
value. (Possibly Windows performed a system-wide install, and a specific user has no rights to access the systemwide home...)I'm afraid there is no
SAGE_HOME
orSAGE_ROOT
or ... and/or no sage shell in the windows install, sorry for this misleading point!That fact that it works when they "Run as administrator" means the Windows permissions are corrupt on the user's home directory.
I have the same problem, namely that I am trying to run Sage 8.3 under Windows 10 64 bit, and need to run as administrator for the Sage kernel not to crash. I was seeing 'permission denied' type error messages when Sage was trying to access the .sage file, and the kernel repeatedly tried to restart. Note that this only applies if you install Sage for all users, which means that the install file must be run as administrator. I uninstalled Sage, and re-installed for a single user, then it works normally.
@BaglartiumusMaximus Thanks that's useful information. It's still a bit strange since before 8.3 install as admin was the only option and it worked fine for most users. So I don't know why other users have messed up permission bits.
i installed sagemath 8.4 on Windows 10. as normal user (no admin rights) when i try to start sagemath 8.4 or sagemath 8.4 Shell or sagemath 8.4 Notebook i get
when i start as admin than sagemath 8.4 Shell or sagemath 8.4 Notebook dit work. sagemath 8.4 will produce: