When a python command is called for the first time, I get "ERROR:root:code for hash blake2b was not found."

16 ビュー (過去 30 日間)
Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv('Version','python3.11');
res = py.list({'This','is a','list'})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
['This', 'is a', 'list']
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ \matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
...
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({'This','is a','list'})
['is a', 'This', 'list']
>>>

回答 (0 件)

製品


リリース

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by