UnicodeEncodeError when import numpy in scripting node


I have a problem with “import numpy” in the python scripting node 1-1. Numpy is already installed in the environment but when I try to use it in Knime I will get following error:

Source code that caused failure:
Traceback (most recent call last):
File “/Applications/KNIME 3.5.3.app/Contents/Eclipse/plugins/org.knime.python2_3.6.0.v201807061638/py/PythonKernelBase.py”, line 278, in execute
exec(source_code, self._exec_env, self._exec_env)
File “”, line 1
Traceback (most recent call last):
File “/Applications/KNIME 3.5.3.app/Contents/Eclipse/plugins/org.knime.python2_3.6.0.v201807061638/py/PythonKernelLauncher.py”, line 86, in
File “/Users/jngo/anaconda2/envs/py35_knime/lib/python3.5/traceback.py”, line 159, in print_exc
print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
File “/Users/jngo/anaconda2/envs/py35_knime/lib/python3.5/traceback.py”, line 101, in print_exception
print(line, file=file, end="")
File “/Applications/KNIME 3.5.3.app/Contents/Eclipse/plugins/org.knime.python2_3.6.0.v201807061638/py/PythonKernelBase.py”, line 382, in write
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xa0’ in position 10: ordinal not in range(128)

Can someone please help?
Thanks in advance!!


Hi Jngo,

What Python version are you using? If it’s older than 2.7, then upgrading to 2.7 could already fix the problem.

Edit: Oops, at least the name of your conda environment suggests that you’re using Python 3.5. I’ll try to reproduce your problem and find a different solution. Could you post the output of executing conda list -n py35_knime via the terminal, please?


1 Like

Hello Marcel,

somehow it is working now after I deinstalled and installed Anaconda and set up the environment again… thanks you anyways :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.