The "...\Python\Python37\site-packages" sub-folder does exist.
When I click that sub-folder, I find "This folder is empty" .
Thanks,
I wouldn't delete it. If there's nothing it it then it's not a problem. Do you have more than one python installed on that machine?
I really don't have enough information to be able to tell you what's wrong. It seems that jupyter isn't all right. You say you installed jupyter lab after installing anaconda, even though jupyter is already part of anaconda. I don't know how you are running jupyter, nor how you installed it and each of these various things, if there's another python in the mix somewhere.
I haven't come across an error like this before, so it seems specific to what you've done on your system. saspy works, which isn't part of jupyter; it's just python and it's at least found by the python you'r running. SAS_kernel *is* a Jupyter thing (it just calls saspy under the covers), and it isn't working but the error is about jupyter can find some unknown file. Can you install other kernels and do they work?
Do you have the log from installing jupyter that you did after installing anaconda?
Is there anyone at your site who understands python installs and can get on your machine to diagnose this? It's hard for me to just guess at things without being on the machine to investigate.
Can you remover all of this and just reinstall anaconda, sas_kernel and saspy and see if they work without doing other things first (keep the logs from your installs so we know what was done)?
Tom
Hi Tom,
While I don't have an admin right, our IT person already re-installed Anaconda in this machine. Per email communication with SAS Institute Technical support, I reinstalled SASPy and SAS_kernel as well.
In a Webex meeting, the SAS technical support guy checked the sas_kernel contents and found all the files in my computer. He commented that "the missing file is in the JupyterLab, Python or Anaconda side." He said, rather than using the Anaconda environment, his suggestion was to try using python outside of the Anaconda environment.
Please let me know if you have any further comments/thoughts.
Thanks,
Well, I would have to agree with tech support that you don't have a completely working jupyter lab installation. What I've gathered is that you have clean install of some version of acnaconda, which includes all the various modules that make up juptyer. You haven't tried using that existing version of jupyter, but have installed some version of one other jupyter module (lab) which is dependent upon all the other parts of jupyter in the existing anaconda. Then it fails when trying to start a kernel with some error about a file not found.
The link I sent earlier about similar problems where users had to install other parts, or maybe update lab so it install all of the other correct version of its dependencies, which maybe would work, it doesn't seem you've tried.
My only guess is that you haven't correctly installed jupyter lab such that it will work correctly with the anaconda version you have.
That's all I can tell at this point. Wish I could just say 'do this' and it would all work, but I don't have enough info to know what that one thing is. Probably install Lab all the way or use the jupyter that was in anaconda in the first place.
Tom
Hi Tom,
Thank you so much for all your guidance and patience!
At this time, I am trying to address your following comment, "The link I sent earlier about similar problems where users had to install other parts, or maybe update lab so it install all of the other correct version of its dependencies, which maybe would work, it doesn't seem you've tried."
Below are my responses.
1) The content of the kernel.JSON file in "python3" subfolder in my machine looks like this:
fd = open('C:/Users/Pradip.Muhuri/AppData/Roaming/Jupyter/kernels/python3/kernel.JSON')
print(fd.read())
fd.close()
{ "argv": [ "C:\\Users\\Pradip.Muhuri\\AppData\\Local\\Continuum\\anaconda3\\python.exe", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], "display_name": "Python 3", "language": "python" }
The above content does not seem to be different from the one in the link you sent me earlier. Am I correct?
2) Below is the content of the kernel.JSON file in the "sas" folder.
fd = open('C:/Users/Pradip.Muhuri/AppData/Roaming/Jupyter/kernels/sas/kernel.JSON')
print(fd.read())
fd.close()
{"argv": ["C:\\ProgramData\\Anaconda3\\python.exe", "-m", "sas_kernel", "-f", "{connection_file}"], "codemirror_mode": "sas", "display_name": "SAS", "language": "sas", "name": "sas"}
The folder specified above for the python.exe file seems to be incorrect given the first line of the output below.
Shall I change the correct the folder name from C:\\ProgramData\\Anaconda3 to C:\\Users\\pradip.muhuri\\AppData\\Local\\Continuum\\anaconda3 in the kernel.JSON file (of the sas sub fiolder)?
import glob
for name in glob.glob('/Users/pradip.muhuri/AppData/Local/Continuum/anaconda3/*.exe'):
print(name)
/Users/pradip.muhuri/AppData/Local/Continuum/anaconda3\python.exe /Users/pradip.muhuri/AppData/Local/Continuum/anaconda3\pythonw.exe /Users/pradip.muhuri/AppData/Local/Continuum/anaconda3\Uninstall-Anaconda3.exe
So, the link I was referring to was of the github issue for users getting the same error you said you got, and what they did to fix it. I haven't seen these files before.
I'm not familiar with those files, and I don't know what directory they are in sub-directories of. But, they seem to be generated, or edited, as part of installation, as they have paths specific to your machine in them. I asked before if you have more than one python installation on your machine, as things seem mismatched. Since these files have the python executable path as well as other of your paths, specific to your machine, it seems the python path would be that of the python you used to install them, but again, I don't know how you've installed these or when. Do, you have more than one python installation? Do you know which one you're using when you installed these various parts? How did you installing them? It looks like you installed the SAS_kernel one with a different python then the python_kernel one was installed with, from what you show.
Sure try changing that path to the python in your home directory anaconda and see what happens. Who knows. maybe it'll work, maybe fail in some other way, maybe make no difference. There are too many things that don't seem to match up here for me to guess.
Tom
Changing that path did not help.
You wanted to know whether I have multiple versions of Python installed in my computer to which only our IT group has the admin right, not the user (me). The following output suggests that there is probably only one version of Python (Anaconda distribution) installed. I don't know why I have two versions of Jupyter installed.
(base) C:\>python --version
Python 3.7.3
(base) C:\>jupyter --version
4.4.0
(base) C:\>jupyter notebook --version
5.7.8
(base) C:\>jupyter kernelspec list
Available kernels:
ir C:\Users\Pradip.Muhuri\AppData\Roaming\jupyter\kernels\ir
python3 C:\Users\Pradip.Muhuri\AppData\Roaming\jupyter\kernels\python3
sas C:\Users\Pradip.Muhuri\AppData\Roaming\jupyter\kernels\sas
Since both you and SAS tech support have determined that there may be issues with Jupyter Lab installations. I would be happy to uninstall jupyter or Jupyter Lab. Any guidance on how to uninstall Jupyter/Jupyter Lab? Is it required that Anaconda distribution of Python be uninstalled and then reinstalled?
Thanks for your continued support.
Well, actually, I'm afraid that output in no way shows whether or not there are other installations of python on your machine. From what you've shown, you have, or at least had (when you installed sas_kernel) anaconda install in the system location in C:\ProgramData\Anaconda3. You also, now at least, have it installed in your user directory. Some things you've installed were done in one and others in the other and I don't think you ever had jupyter lab installed correctly. That is what my guess is from what I've seen here.
But, I think you are on to something. I suggest your IT staff get on your machine, clean up any of this python you've tried to install, make there be only on version of anaconda installed, wherever, and have them then install any other things you want on there till they work. Then you can simply use it to do what you are really trying to accomplish - using it. They should be able to install all of the things you need so that it all works.
Thanks,
Tom
Hi Tom,
What would be the best way to:
1) find whether I have multiple versions of Python installed in my machine?
2) uninstall Python - uninstall app in Wondows 10?
3) uninstall jupyterLab?
Thanks,
Well, I really think your IT staff should do this. You said they installed and reinstalled anaconda for you already. I just worked on another issue like this where things didn't match up because of having different python things installed and the sas_kernel wasn't found even though saspy was and pip didn't really turn out to be the expected one ...
I think you have the same problem and you need someone who can get on your computer who knows how to clean up whatever is/was on there and get one clean install that works like expected. As for Jupyter lab, I have been trying to install anaconda different ways on windows, as part of trying to understand what your situation might be. Jupyer Lab is already installed in Anaconda. I didn't need to install it after the fact.
In fact, I installed anaconda as a user (not admin) and installed sas_kernel (which installs, depends on, saspy) and it works just fine. I started jupyter lab from the anaconda navigator (I've never used that before), and both saspy and sas_kernel worked. Trying to attach a picture; we'll see if that work. Well, can't attach a pic, so putting it in a word doc.
Can your IT people do this for you?
Thanks,
Tom
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.
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
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.