python - How to change Python version used by Bokeh?
问题描述
When I launch my Python application I use the command: bokeh serve application.py
This was working before on a Windows machine where only one Python version existed.
Now I am on a Linux machine where I have Python (version 2.7) and Python3 (version 3.4).
There is some native stuff on Linux using Python 2.7 so I cannot rename Python3 to Python.
Is there a way to tell Bokeh to use another Python version? If I do Bokeh info indeed says that the Python version is 2.7.
解决方案
Bokeh 不“使用” Python 版本。Bokeh 安装在 Python 环境中,当您bokeh serve
从相应环境运行 Python 版本时,将使用该版本。这就是 Python 的一般工作方式,Bokeh 无法表现出不同的行为。
最可能的解释是您有多个 Python 环境,而 Python 2.7 环境首先在您的系统上PATH
。确保将 Bokeh 安装到 Python 3 环境中(即安装到它的site-packages
)中,并确保bin
Python 3 环境的目录首先位于您的路径中(或通过提供正确路径的完整绝对路径来运行 Bokeh 服务器)。
或者,您可以使用以下命令运行 Bokeh 服务器-m
:
python -m bokeh serve app.py
在这种情况下,您可以直接控制使用哪个 Python 可执行文件。
推荐阅读
- python - 我不明白为什么我不能让 python 中的 readline 函数在这个程序中工作。我究竟做错了什么?
- ios - AVAssetWriter 仅在 iOS 13 设备上具有音频“噼啪声”
- python-3.x - pyspark中基于rdd的操作中键值的最大值
- python - 如果列表作为 y 传递,Keras 中 y_true 的形状是什么?
- r - 在 R 中的字符串上使用 If / Else if 时出现错误
- python - 如何在数据框中找到另一个没有循环的相关行
- css - 链接和文本的 CSS 位置集中在特定的屏幕尺寸/分辨率上
- r - 如何计算更快的月度加权平均值
- php - 刚刚升级了 Bitnami WAMP 堆栈,现在我的 PHP 文件正在忽略文件更改
- python - 连接字符串的 Pandas keyerror