Hi KNIMErs,
I’m trying to bundle a Python-based extension for KAP v5.1.0 from a Windows machine, but keep running into a UnicodeDecodeError:
(knime_5.1.0_extension_bundling) C:\>build_python_extension.bat C:\Users\[MY USERNAME]\Documents\KNIME\Extensions\[my extension folder] C:\Users\[MY USERNAME]\Desktop\[my extension name]_v1.0.0_knime5.1.0
(knime_5.1.0_extension_bundling) C:\>python "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\build_python_extension.py" C:\Users\[MY USERNAME]\Documents\KNIME\Extensions\[my extension folder] C:\Users\[MY USERNAME]\Desktop\[my extension name]_v1.0.0_knime5.1.0
INFO:__main__:Filling template files from C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\templates\python-extension-plugin
and storing the resulting plugin to
C:\Users\[MY USERNAME]\AppData\Local\Temp\tmpycz0kupf\[my extension name]\src\main\python.
Using bundle name '[my extension name].channel.bin'.
Using plugin template from 'C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\templates\conda-channel-plugin'.
Rendering plugin to 'C:\Users\[MY USERNAME]\AppData\Local\Temp\tmpycz0kupf\[my extension name].channel.bin'...
Using bundle name '[my extension name].channel.bin'.
Using fragment template from 'C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\templates\conda-channel-platform-fragment'.
Rendering fragment for linux-64 to 'C:\Users\[MY USERNAME]\AppData\Local\Temp\tmpycz0kupf\[my extension name].channel.bin.linux.x86_64'...
Running 'conda-lock lock --micromamba --no-mamba -f C:\Users\[MY USERNAME]\Documents\KNIME\Extensions\[my extension folder]\conda_env.yml -c conda-forge -c knime -p linux-64 --lockfile C:\Users\[MY USERNAME]\AppData\Local\Temp\tmpxkgsbinx\lockfile'...
Traceback (most recent call last):
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\build_python_extension.py", line 524, in <module>
build_extension(
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\build_python_extension.py", line 72, in build_extension
_build_extension(
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\build_python_extension.py", line 119, in _build_extension
bundles += _create_conda_channels(render_dir_path, force, config)
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\build_python_extension.py", line 352, in _create_conda_channels
return bundler.bundle()
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\bundle_channels.py", line 81, in bundle
self._bundle_fragment(
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\bundle_channels.py", line 114, in _bundle_fragment
gather_env_specs(
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\gather_env_specs.py", line 132, in gather_env_specs
_perform_with_conda_lock(
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\gather_env_specs.py", line 41, in _perform_with_conda_lock
lockfile_dict = _run_conda_lock(env_yaml, platform, channels, lockfile)
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\gather_env_specs.py", line 79, in _run_conda_lock
run_and_capture(command)
File "C:\Users\[MY USERNAME]\Miniconda3\envs\knime_5.1.0_extension_bundling\bin\utils.py", line 128, in run_and_capture
+ f" Standard error: '{output.stderr.decode()}'"
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 1864: invalid start byte
Based on the exception above, I believe that the problem is somehow related to my conda_env.yml. It is UTF-8 encoded and follows the example of the official guide:
name: [my extension's environment name]
channels:
- conda-forge
- knime
dependencies:
- python=3.11
- knime-extension=5.1
- knime-python-base=5.1
- pip:
- [a pip package]
I have been racking my brains over this for hours now, so any help in fixing this will be much appreciated.
Cheers!
15 posts - 4 participants