1

I am trying to install bokey and repeatedly failed. I have broken this down to the following steps:

I have created a new and otherwise empty environment

conda create -n py37 pip python=3.7
activate py37

and have sucessfully installed bokeh

conda install bokeh

Running a given hello world example such as

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)

I end up with an error

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.

When I follow hints how to reinstall numpy in that situation given here, I seem to break the Pillow installation:

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.

What am I missing?

UPDATE: It seems that the problem is related to the WingIDE I am using. I cannot reproduce the problem in spyder

bigreddot
  • 33,642
  • 5
  • 69
  • 122
tfv
  • 6,016
  • 4
  • 36
  • 67

1 Answers1

2

This occurs when you install Anaconda without selecting the option to set PATH in the installer (which indeed is recommended to not be set now since it can cause conflicts with other Python installations).

Wing 7.2 added support to compensate for this by activating the base environment before trying to use Anaconda, so I think upgrading will solve it. See https://wingware.com/doc/howtos/anaconda for some details on using the latest Wing version with Anaconda.

If you can't upgrade, look at the Anaconda How-To in Wing's Help menu instead, which is appropriate for the version you are running and explains how to solve it there.

Stephan
  • 144
  • 4
  • Stephan, the Answer is helpful, but does not solve my problem yet, I'll have to spend some more time digging into it. Wingide still the raises numpy error, while spyder does not. – tfv Mar 21 '20 at 16:52
  • Assuming you have the latest Wing (including doing Check for Updates in the Help menu), what is Python Executable set to in your project? It should be set to Activated Env and then select py37 from the drop down to the right of the entry area. – Stephan Mar 23 '20 at 14:07
  • I am aware of this, that is exactly what I have done. – tfv Mar 23 '20 at 14:24
  • Sorry, I'm not sure what is going wrong, then. Comparing sys.path and os.environ in Wing and Spyder would at least show what is missing, and adding to the Python Path and Environment in Wing's Project Properties might be a way to work around this. – Stephan Mar 23 '20 at 19:00