我正在尝试安装bokey,并且反复失败。我将其分解为以下步骤:
我创建了一个新的,否则为空的环境
conda create -n py37 pip python=3.7
activate py37
并成功安装了bokeh
conda install bokeh
运行给定的hello world示例,例如
from bokeh.plotting import figure, output_file, show
# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to static HTML file
output_file("lines.html")
# create a new plot with a title and axis labels
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
# add a line renderer with legend and line thickness
p.line(x, y, legend_label="Temp.", line_width=2)
# show the results
show(p)
我最终遇到错误
builtins.ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "c:\Users\<name>\Miniconda3\envs\py37-bk2\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
当我遵循提示如何在给定here的情况下重新安装numpy时,我似乎中断了Pillow的安装:
File "c:\Users\<name>\Miniconda3\envs\py37-bk2\Lib\site-packages\PIL\Image.py", line 69, in <module>
from . import _imaging as core
builtins.ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
我想念什么?
更新:该问题似乎与我使用的WingIDE有关。我无法在spyder中重现该问题
答案 0 :(得分:2)
当您在安装Anaconda时未选择在安装程序中设置PATH的选项时会发生这种情况(实际上建议您现在不设置 ,因为它可能会与其他Python安装发生冲突。)
Wing 7.2增加了支持,以通过尝试使用Anaconda之前激活基本环境来补偿此问题,因此我认为升级将解决该问题。有关将最新的Wing版本与Anaconda结合使用的详细信息,请参见https://wingware.com/doc/howtos/anaconda。
如果无法升级,请改用Wing的“帮助”菜单中的“ Anaconda How-To”,该菜单适用于您所运行的版本,并说明了如何解决该问题。