- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created a conda environment called "py36" and used the "ipykernel" tool to add it to the Jupyter Kernels. I see it listed in the GUI:
However, even though I selected it, I could not use the packages I installed. For example "seaborn" is one of those packages (see image below). I used the "conda env list" command to see whether the "py36" kernel is used, but the * is next to "base".
It seems like the kernel I selected is ignored.
I can also show from the terminal that seaborn is installed in py36 and not base:
Has anyone encountered this behavior before? How do I solve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the update.
In jupyter notebook,if you use '!' before the command, it will run in a new terminal.Since this command runs in new terminal in the base environment, conda list shows base as the working environment with * symbol.
Hope this answers your question!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel forums.
First check the python path in jupyter notebook by running import sys sys.executable in the cell.If it shows /glob python then do the following
1)Go to /home/{username}/.local/share/jupyter/kernels/{environment name}
2)Open kernel.json file in that folder
3)Replace the python path with your environment python path.
4)After changing the path, run import sys;sys.executable in the cell and check the path.
Try this and let us know the updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. The results after I followed the steps are in the picture, it did not work. I am printing the "conda env list" command again. The base environment is selected when it should be py36.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did you restart the kernel in jupyter notebook after editing the kernel.json file? It might work if you restart the kernel multiple times.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I did restart the kernel, I even created a new notebook. What I see is that after a few seconds the kernel name on the top right corner of Jupyter turns to No Kernel!
A few seconds later (or click on run):
As a workaround, I ended up using "pip" with the "--user" flag to install what I need on the base conda environment. However, I still wish I could use multiple conda environments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did that work? Do you have any update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the update.
Try to remove your kenel with jupyter kernelspec remove <kernel_name> command and add kernel again with ipython kernel install --name "env_name" --user command.We faced similar issue and we were able to solve the issue with the above step.
Kindly try out the above steps and let us know the updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have removed the kernel, but I do not have permission to run the command you have given to install again:
(base) u45638@s001-n001:~$ ipython kernel install --name py36
[Errno 13] Permission denied: '/usr/local/share/jupyter'
The first time, I used the --user flag. I used it this time as well and I encounter the same issue: when I list the conda environments, "base" is selected instead of "py36":
I activated py36 on the terminal, and you can see I have a version of "seaborn" installed, which was not shown in the second cell of the above notebook.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You get this"[Errno 13] Permission denied: '/usr/local/share/jupyter'" because you are trying to install in base environment.Try after deactivating the base environment ,you will be able to run,like below.
(base) uxxxxx@s001-n017:~$ ipython kernel install --name py36
[Errno 13] Permission denied: '/usr/local/share/jupyter'
(base) uxxxxx@s001-n017:~$ conda deactivate
uxxxxx@s001-n017:~$ ipython kernel install --name py36
[Errno 13] Permission denied: '/usr/local/share/jupyter'
uxxxxx@s001-n017:~$ ipython kernel install --name py36 --user
Installed kernelspec py36 in /home/uxxxxx/.local/share/jupyter/kernels/py36
Hope this answers your query!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, but I was not able to reinstall yet because ipython module is not installed in the system:
(base) u45638@s001-n057:~$ conda deactivate
u45638@s001-n057:~$ ipython kernel install --name py36 --user
Command 'ipython' not found, but can be installed with:
apt install ipython
Please ask your administrator.
u45638@s001-n057:~$ which python
/usr/bin/python
How should I proceed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the update.
The issue may be due to python path.So you can try any of the below steps.
1)Try to source oneapi environment with source setvars.sh command.After sourcing,your python path will be "/glob/development-tools/versions/oneapi/beta10/inteloneapi/intelpython/latest/bin/python".You can check that with "which python" command.After this you can proceed with "ipython kernel install --name py36 --user" command.
2)You can also solve this issue by exporting the python path like below.
uxxxxx@s001-n022:~$ which python
/usr/bin/python
uxxxxx@s001-n022:~$ export PATH=/glob/intel-python/python3/bin:$PATH
uxxxxx@s001-n022:~$ which python
/glob/intel-python/python3/bin/python
uxxxxx@s001-n022:~$ ipython kernel install --name py36 --user
Installed kernelspec py36 in /home/uxxxxx/.local/share/jupyter/kernels/py36
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Has the solution provided helped?Please let us know if the issue still persists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
This time, when I deactivated conda, the global python was set by default and was able to use ipython
However, when I list the conda environments from the jupyter notebook, I still see it picked the "base" one:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the update.
In jupyter notebook,if you use '!' before the command, it will run in a new terminal.Since this command runs in new terminal in the base environment, conda list shows base as the working environment with * symbol.
Hope this answers your question!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did that help?Could you give us an update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are assuming that the solution provided helped and would no longer be monitoring this issue.Please raise a new thread if you have any further issues.
Regards,
Janani Chandran
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page