Ok, so I’ve been looking into what happens when you have two copies of anaconda installed, as I mentioned in the last post.
Based upon some of the output you provided so far, I’ve correlated that with what I’ve tried and seen.
There are different options when installing anaconda regarding setting the default python and updating system paths. in all cases so far I’ve taken the default for that. The non-default states that it’s not recommended.
There are 2 places anaconda can be installed. You have (or at least had) it in both places:
The system (all users): 'C:\ProgramData\Anaconda3
Your user only: 'C:\Users\[user name]\Anaconda3
When installing packages, there a --user option that can be specified. I’ve never used that, but on this system I did it and I see that there’s a new extra directory created for this in the user directory and this path is then added to the python path for both instances of anaconda. You did this at lease some time because that directory is in yout path, even though it is now empty.
Jupyter (notebook and lab) have a number of paths where it keep metadata. Specifically for this issue, the kernel metadata. This is also in the user directory, so it is found regardless of what python Jupyter is running in.
So, what I’ve seen regarding the sas_kernel, matches up with problems you are having with it due to both python installs.
I don’t know what problems you trying to install Jupyter lab yourself might have caused or not. The anaconda I installed already has both Jupyter lab and notebook, so I haven’t tried doing anything with installing lab.
The following are the Jupyter paths for Jupyter from each of the python installs:
C:\Users\tomuser>C:\Users\tomuser\Anaconda3\Scripts\jupyter.exe --paths
config:
C:\Users\tomuser\.jupyter
C:\Users\tomuser\Anaconda3\etc\jupyter
C:\ProgramData\jupyter
data:
C:\Users\tomuser\AppData\Roaming\jupyter
C:\Users\tomuser\Anaconda3\share\jupyter
C:\ProgramData\jupyter
runtime:
C:\Users\tomuser\AppData\Roaming\jupyter\runtime
C:\Users\tomuser>c:\ProgramData\Anaconda3\Scripts\jupyter.exe --paths
config:
C:\Users\tomuser\.jupyter
c:\ProgramData\Anaconda3\etc\jupyter
C:\ProgramData\jupyter
data:
C:\Users\tomuser\AppData\Roaming\jupyter
c:\ProgramData\Anaconda3\share\jupyter
C:\ProgramData\jupyter
runtime:
C:\Users\tomuser\AppData\Roaming\jupyter\runtime
The python paths from each of the installs are as follows. This is after having done a --user install of a package.
Prior to ever doing a --user install, the Roaming\\Python\\Python37\\site-packages path was not in either path and
the directory didn’t exist.
>>> sys.path
['',
'C:\\Users\\tomuser\\Anaconda3\\python37.zip',
'C:\\Users\\tomuser\\Anaconda3\\DLLs',
'C:\\Users\\tomuser\\Anaconda3\\lib',
'C:\\Users\\tomuser\\Anaconda3',
['C:\\Users\\tomuser\\AppData\\Roaming\\Python\\Python37\\site-packages', ] -only after --user install
'C:\\Users\\tomuser\\Anaconda3\\lib\\site-packages',
'C:\\Users\\tomuser\\Anaconda3\\lib\\site-packages\\win32',
'C:\\Users\\tomuser\\Anaconda3\\lib\\site-packages\\win32\\lib',
'C:\\Users\\tomuser\\Anaconda3\\lib\\site-packages\\Pythonwin']
>>>
>>>> sys.path
['',
'C:\\ProgramData\\Anaconda3\\python37.zip',
'C:\\ProgramData\\Anaconda3\\DLLs',
'C:\\ProgramData\\Anaconda3\\lib',
'C:\\ProgramData\\Anaconda3',
['C:\\Users\\tomuser\\AppData\\Roaming\\Python\\Python37\\site-packages', ] -only after --user install
'C:\\ProgramData\\Anaconda3\\lib\\site-packages',
'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32',
'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32\\lib',
'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\Pythonwin']
>>>
So, Jupyter Jupyter has metadata about sas_kernel (you’ve shown those files) in the user directory and inside that file is the python executable that you used to install it. In your case, C:\Users\[user name]\AppData\Roaming\jupyter\kernels\sas\kernel.json shows C:\ProgramData\Anaconda3\python.exe. But, from inside a python notebook in Jupyter, you’ve shown that the python it is running in is your user install: 'C:\Users\[]user name\Anaconda3\python.exe.
So, the sas_kernel will not load when I have it installed like that where it’s in the python that isn’t the one I’m running Jupyter from. You also have installed something using --user at some point also, though you show that directory as empty. So I guess you’ve uninstalled whatever was there. Again, I don’t know anything about what issues might be happening from you doing a pip install jupyterlab from whichever python you did that from. I don’t know what version of anaconda you have in either place.
There are too many unknowns for me to tell you what to do on your system. And you’re not an administrator, so you probably can’t do some of it anyway. But, this information may help your IT staff figure out how to clean up your system, if they aren’t familiar themselves with all of this themselves (I don’t know).
I’ve at least learned a bit about what can go wrong when you have this situation. Though, when I uninstalled and then installed sas_kernel using the right install of python, it just worked with no issue.
I hope this helps in some way.
Tom
... View more