Jupyter笔记本中的Python包版本(bokeh)与终端中的版本不同

Jupyter笔记本中的Python包版本(bokeh)与终端中的版本不同,python,jupyter-notebook,virtualenv,jupyter,Python,Jupyter Notebook,Virtualenv,Jupyter,我在终端中使用pip将Bokeh安装到虚拟环境中。但是,从该虚拟环境启动Jupyter笔记本服务器并打开笔记本时,bokeh(0.12.9)的版本与终端中安装的版本I(0.13.0)不同 从Jupyter笔记本服务器终端: pip3 install --upgrade bokeh ... python3 Python 3.6.4 (default, Mar 9 2018, 23:15:03) GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.

我在终端中使用pip将Bokeh安装到虚拟环境中。但是,从该虚拟环境启动Jupyter笔记本服务器并打开笔记本时,bokeh(0.12.9)的版本与终端中安装的版本I(0.13.0)不同

从Jupyter笔记本服务器终端:

pip3 install --upgrade bokeh
...
python3
Python 3.6.4 (default, Mar  9 2018, 23:15:03)
GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bokeh
>>> bokeh.__version__
'0.13.0'
从新的iPython笔记本中:

import sys
print(sys.version)
import bokeh
print(bokeh.__version__)

>>> 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:14:59) 
>>> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
>>> '0.12.9'
我已经检查过笔记本是否也在运行Python3(尽管它是另一个版本,看起来很可疑…)


如何升级笔记本中运行的Bokeh版本?关于堆栈溢出(,)我能找到的最密切相关的问题似乎不起作用,可能是因为它们特定于conda,我没有安装它。

您是否在您的环境之外安装了另一个python?如果是,请在启动环境之前,在终端中键入
unset PYTHONPATH
。是的,Jupyter没有获得“正确”的Python版本是问题所在。它正在连接到另一个内核。我尝试了一些方法,最终解决问题的方法是升级ipykernel。之后,virtualenv内核对Jupyter可见。下一次,我将使用conda:)