Biên dịch máy xay sinh tố - Lỗi Python
Oct 11 2020
Tôi là một noob khi nói đến việc biên dịch. Tôi đã làm theo hướng dẫn để biên dịch Blender trên OpenSuse Linux.
https://wiki.blender.org/wiki/Building_Blender/Linux/OpenSUSE
Tôi đã tải xuống các nguồn. Tôi đã tải xuống các thư viện.
Nhưng khi tôi làm theo hướng dẫn Cập nhật và Xây dựng
cd /home/myprofile/bin/blender-git/blender/
make update
Tôi gặp lỗi sau:
python3 ./build_files/utils/make_update.py
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = '/usr/local/lib/python:/usr/lib64/python/'
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3'
sys.base_prefix = '/usr'
sys.base_exec_prefix = '/usr'
sys.executable = '/usr/bin/python3'
sys.prefix = '/usr'
sys.exec_prefix = '/usr'
sys.path = [
'/usr/local/lib/python',
'/usr/lib64/python/',
'/usr/lib/python38.zip',
'/usr/lib64/python3.8',
'/usr/lib64/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
File "/usr/lib64/python/encodings/__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Current thread 0x00007f9baaa00740 (most recent call first):
<no Python frame>
make: *** [GNUmakefile:504: update] Error 1
Trả lời
RobertGützkow Oct 13 2020 at 16:04
Vấn đề là do PYTHONPATH. Có vẻ như nó /usr/lib64/python/trỏ đến các thư viện của Python 2.7, dẫn đến lỗi nói trên. Biến PYTHONPATHmôi trường có thể tạm thời bị xóa đối với terminal hiện tại bằng lệnh unset PYTHONPATHmà sau đó bạn có thể chạy make updatethành công.