I already referred to this related post
Currently am using Jupyter Notebook which has Python2 kernel only. But my server has both Python2 and Python3.
However, I would like to add python3 kernel. By following the above post, I tried the below
1 !mkdir python-virtual-environments && cd python-virtual-environments && virtualenv env && virtualenv -p python3 env && . env/bin/activate   #activated virtual environment
2 !jupyter kernelspec list  #lists only Python2 kernel  
3 !which python3 # outputs the python3 path `/usr/bin/python3`
4 !pip install ipykernel  # stream of requirement already satisfied messages
5 !python3 -m pip install ipykernel  # error-1
6 !python3 -m ipykernel install --user # error-2 
I get the below errors
error-1
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.5/shutil.py", line 538, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/prompt_toolkit' -> '/tmp/pip-rgd7fgjj-uninstall/usr/lib/python3/dist-packages/prompt_toolkit
.....
PermissionError: [Errno 13] Permission denied: 'toolbars.py'
error-2
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/tornado-6.0.4.dist-info'
You are using pip version 9.0.1, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/usr/bin/python3: No module named ipykernel
Questions
- When I activate the - virtualenv, all the commands that I execute after activation (line 2,3,4,5,6) are being run in my virtual env. Am I right?
- line 4 has a stream of requirement already satisified messages. Am trying to install - ipykernelin my virtual environment. Why does it say it's already satisfied. Is it looking at my system installation because the message has python2.7.2?
- Line 5, Why do I get - permission deniederror?
 
    