Blenderのコンパイル-Pythonエラー

Oct 11 2020

コンパイルに関しては、私は初心者です。OpenSuseLinuxでBlenderをコンパイルするための指示に従いました。

https://wiki.blender.org/wiki/Building_Blender/Linux/OpenSUSE

ソースをダウンロードしました。ライブラリをダウンロードしました。

しかし、更新とビルドの指示に従うと

cd /home/myprofile/bin/blender-git/blender/
make update

次のエラーが発生します。

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

回答

RobertGützkow Oct 13 2020 at 16:04

この問題の原因はPYTHONPATHです。/usr/lib64/python/Python 2.7のライブラリを指しているようで、前述のエラーが発生します。PYTHONPATHコマンドunset PYTHONPATHを使用して、現在の端末の環境変数を一時的に削除できます。その後、make update正常に実行できるようになります。