操作系统:Ubuntu 16.04 lts
我使用 virtualenvironmentwrapper 创建了一个虚拟环境“analytics-3”,并且觉得需要使用 Jupyter notebook 来完成一些工作。
Python版本:- 3.5.2
下载 Anaconda3-4.3.0-Linux-x86_64.sh 并在虚拟环境之外安装 anaconda。
“jupyter notebook”运行完美。
我想为这个特定的“analytics-3”虚拟环境制作一个内核并按照以下步骤操作:-
1)激活分析3(使用workon)
2)在里面安装了ipykernel
3)尝试使用以下方法在 jupyter notebook 中安装内核:-
python -m ipykernel install --user --name analytics-3 --display-name "xyz"
收到此错误:-
回溯(最近一次通话最后):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/odin/.virtualenvs/analytics-3/lib/python3.5/site-packages/ipykernel/__main__.py", line 2, in <module>
from ipykernel import kernelapp as app
File "/home/odin/.virtualenvs/analytics-3/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 15, in <module>
from tornado import ioloop
File "/home/odin/.virtualenvs/analytics-3/lib/python3.5/site-packages/tornado/ioloop.py", line 45, in <module>
from tornado.concurrent import (
File "/home/odin/.virtualenvs/analytics-3/lib/python3.5/site-packages/tornado/concurrent.py", line 175, in <module>
future: Union["futures.Future[_T]", "Future[_T]"], value: _T
File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
dict(self.__dict__), parameters, _root=True)
File "/usr/lib/python3.5/typing.py", line 512, in __new__
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 190, in __subclasscheck__
self._eval_type(globalns, localns)
File "/usr/lib/python3.5/typing.py", line 177, in _eval_type
eval(self.__forward_code__, globalns, localns),
File "<string>", line 1, in <module>
TypeError: 'type' object is not subscriptable
一个简单的谷歌搜索不亮。请指导我如何解决这个问题。