1/1

Fedora Linux 37でpythonの切り替え

■ヘルプ
$ alternatives --help
alternatives バージョン 1.21 - Copyright (C) 2001 Red Hat, Inc.
これは GNU 一般公有使用許諾書の規定の元で自由に再配布することができます。

使用法: alternatives --install <リンク> <名前> <パス> <優先度>
[--initscript <サービス>]

[--family ]
[--follower ]*
alternatives --remove <名前> <パス>
alternatives --auto <名前>
alternatives --config <名前>
alternatives --display <名前>
alternatives --set
alternatives --list
alternatives --remove-all
alternatives --add-follower
alternatives --remove-follower
ーーーーーーーーーーーーーーーーーーーーー
■確認
$ alternatives --config python

3 プログラムがあり 'python' を提供します。

選択 コマンド
-----------------------------------------------
* 1 /usr/bin/python3.8
2 /usr/bin/python2.7
+ 3 /usr/bin/python3.11

ーーーーーーーーーーーーーーーーーーーーー
■アップグレードで削除されたバージョンのpython3.8のパスを削除する。
$ sudo alternatives --remove python /usr/bin/python3.8

ーーーーーーーーーーーーーーーーーーーーー
■確認
$ alternatives --config python

2 プログラムがあり 'python' を提供します。

選択 コマンド
-----------------------------------------------
*+ 1 /usr/bin/python3.11
2 /usr/bin/python2.7

■使用感
1400円で買った、外付け2.5インチSSDケースに、Fedora32からFedora37までにアップグレード。32--->34--->36--->37
5時間かかりました。ありがとうございます。
  • -
  • -

Pixar RenderMan24.4 install under Linux lite4.2

sudo apt-get -y install alien

sudo alien -cv RenderMan-InstallerNCR-24.4.0_2226589-linuxRHEL7_gcc63icc190.x86_64.rpm

sudo dpkg -i renderman-installerncr_24.4.02226589-1_amd64.deb

sudo alien -cv libicu-50.2-4.el7_7.x86_64.rpm
https://rpmfind.net/linux/rpm2html/search.php?query=libicui18n.so.50()(64bit)

sudo dpkg -i libicu_50.2-5_amd64.deb

cd /etc/ld.so.conf.d

sudo nano hoge.conf

sudo ldconfig

sudo ldconfig -p | grep libicui18n
libicui18n.so.66 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicui18n.so.66
libicui18n.so.60 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicui18n.so.60
libicui18n.so.55 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicui18n.so.55
libicui18n.so.50 (libc6,x86-64) => /usr/lib64/libicui18n.so.50


sudo ./RenderManInstaller

export RMANTREE=/opt/pixar/RenderManProServer-24.4/

export PYTHONPATH=$PYTHONPATH:$RMANTREE/bin
export PYTHONPATH=$PYTHONPATH:$RMANTREE/bin/pythonbindings

Thank you
001.png
002.png
003.png
  • -
  • -

Fedora Linux 37でpython cgkit pyODE install

Fedora30以降、pyODEはパッケージでないので、以下インストールしてみました。
■Download PyODE-snapshot-2010-03-22.tar.gz

■PyODE-snapshot-2010-03-22]$ python setup.py build
INFO: found in /usr/include
INFO: Creating ode_trimesh.c
pyrexc -o ode_trimesh.c -I. -Isrc src/ode.pyx
sh: 行 1: pyrexc: コマンドが見つかりません
ERROR: An error occured while generating the C source file.

■Download Pyrex-0.9.9.tar.gz
$ sudo python setup.py install
copying build/scripts-2.7/pyrexc -> /usr/bin
changing mode of /usr/bin/pyrexc to 755
running install_data
copying Pyrex/Compiler/Lexicon.pickle -> /usr/lib/python2.7/site-packages/Pyrex/Compiler
running install_egg_info
Writing /usr/lib/python2.7/site-packages/Pyrex-0.9.9-py2.7.egg-info

■pyODEのbuild
PyODE-snapshot-2010-03-22]$ python setup.py build
INFO: found in /usr/include
INFO: Creating ode_trimesh.c
pyrexc -o ode_trimesh.c -I. -Isrc src/ode.pyx
/home/mac/Downloads/PyODE-snapshot-2010-03-22/src/mass.pyx:263:18: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
INFO: Creating ode_notrimesh.c
pyrexc -o ode_notrimesh.c -I. -Isrc src/ode.pyx
/home/mac/Downloads/PyODE-snapshot-2010-03-22/src/mass.pyx:263:18: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
INFO: Installing with trimesh support.
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/xode
copying xode/errors.py -> build/lib.linux-x86_64-2.7/xode
copying xode/body.py -> build/lib.linux-x86_64-2.7/xode
copying xode/parser.py -> build/lib.linux-x86_64-2.7/xode
copying xode/transform.py -> build/lib.linux-x86_64-2.7/xode
copying xode/geom.py -> build/lib.linux-x86_64-2.7/xode
copying xode/node.py -> build/lib.linux-x86_64-2.7/xode
copying xode/__init__.py -> build/lib.linux-x86_64-2.7/xode
copying xode/joint.py -> build/lib.linux-x86_64-2.7/xode
running build_ext
building 'ode' extension
creating build/temp.linux-x86_64-2.7
gcc -fno-strict-aliasing -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/include/python2.7 -c ode_trimesh.c -o build/temp.linux-x86_64-2.7/ode_trimesh.o
ode_trimesh.c: 関数 ‘__pyx_f_3ode_4Mass_setCappedCylinder’ 内:
ode_trimesh.c:907:3: 警告: ‘dMassSetCappedCylinder’ is deprecated [-Wdeprecated-declarations]
907 | dMassSetCappedCylinder((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);
| ^~~~~~~~~~~~~~~~~~~~~~
次のファイルから読み込み: /usr/include/ode/ode.h:40,
次から読み込み: ode_trimesh.c:32:
/usr/include/ode/mass.h:84:33: 備考: ここで宣言されています
84 | ODE_API_DEPRECATED ODE_API void dMassSetCappedCylinder(dMass *a, dReal b, int c, dReal d, dReal e);
| ^~~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_4Mass_setCappedCylinderTotal’ 内:
ode_trimesh.c:946:3: 警告: ‘dMassSetCappedCylinderTotal’ is deprecated [-Wdeprecated-declarations]
946 | dMassSetCappedCylinderTotal((&((struct __pyx_obj_3ode_Mass *)__pyx_v_self)->_mass),__pyx_1,__pyx_2,__pyx_3,__pyx_4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ode/mass.h:85:33: 備考: ここで宣言されています
85 | ODE_API_DEPRECATED ODE_API void dMassSetCappedCylinderTotal(dMass *a, dReal b, int c, dReal d, dReal e);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_11Hinge2Joint_setAxis1’ 内:
ode_trimesh.c:8143:3: 警告: ‘dJointSetHinge2Axis1’ is deprecated [-Wdeprecated-declarations]
8143 | dJointSetHinge2Axis1(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);
| ^~~~~~~~~~~~~~~~~~~~
次のファイルから読み込み: /usr/include/ode/ode.h:42:
/usr/include/ode/objects.h:1986:33: 備考: ここで宣言されています
1986 | ODE_API_DEPRECATED ODE_API void dJointSetHinge2Axis1 (dJointID j, dReal x, dReal y, dReal z);
| ^~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_11Hinge2Joint_setAxis2’ 内:
ode_trimesh.c:8232:3: 警告: ‘dJointSetHinge2Axis2’ is deprecated [-Wdeprecated-declarations]
8232 | dJointSetHinge2Axis2(((struct __pyx_obj_3ode_Hinge2Joint *)__pyx_v_self)->__pyx_base.jid,__pyx_3,__pyx_4,__pyx_5);
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/ode/objects.h:1996:33: 備考: ここで宣言されています
1996 | ODE_API_DEPRECATED ODE_API void dJointSetHinge2Axis2 (dJointID j, dReal x, dReal y, dReal z);
| ^~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_13GeomTransform___cinit__’ 内:
ode_trimesh.c:13433:12: 警告: ‘dCreateGeomTransform’ is deprecated [-Wdeprecated-declarations]
13433 | ((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid = dCreateGeomTransform(__pyx_v_sid);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
次のファイルから読み込み: /usr/include/ode/ode.h:44:
/usr/include/ode/collision.h:1089:36: 備考: ここで宣言されています
1089 | ODE_API_DEPRECATED ODE_API dGeomID dCreateGeomTransform (dSpaceID space);
| ^~~~~~~~~~~~~~~~~~~~
ode_trimesh.c:13436:3: 警告: ‘dGeomTransformSetCleanup’ is deprecated [-Wdeprecated-declarations]
13436 | dGeomTransformSetCleanup(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ode/collision.h:1092:33: 備考: ここで宣言されています
1092 | ODE_API_DEPRECATED ODE_API void dGeomTransformSetCleanup (dGeomID g, int mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_13GeomTransform_setGeom’ 内:
ode_trimesh.c:13606:3: 警告: ‘dGeomTransformSetGeom’ is deprecated [-Wdeprecated-declarations]
13606 | dGeomTransformSetGeom(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,((dGeomID)__pyx_v_id));
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ode/collision.h:1090:33: 備考: ここで宣言されています
1090 | ODE_API_DEPRECATED ODE_API void dGeomTransformSetGeom (dGeomID g, dGeomID obj);
| ^~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_13GeomTransform_setInfo’ 内:
ode_trimesh.c:13672:3: 警告: ‘dGeomTransformSetInfo’ is deprecated [-Wdeprecated-declarations]
13672 | dGeomTransformSetInfo(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid,__pyx_v_mode);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ode/collision.h:1094:33: 備考: ここで宣言されています
1094 | ODE_API_DEPRECATED ODE_API void dGeomTransformSetInfo (dGeomID g, int mode);
| ^~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_13GeomTransform_getInfo’ 内:
ode_trimesh.c:13694:3: 警告: ‘dGeomTransformGetInfo’ is deprecated [-Wdeprecated-declarations]
13694 | __pyx_1 = PyInt_FromLong(dGeomTransformGetInfo(((struct __pyx_obj_3ode_GeomTransform *)__pyx_v_self)->__pyx_base.gid)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; goto __pyx_L1;}
| ^~~~~~~
/usr/include/ode/collision.h:1095:32: 備考: ここで宣言されています
1095 | ODE_API_DEPRECATED ODE_API int dGeomTransformGetInfo (dGeomID g);
| ^~~~~~~~~~~~~~~~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_11TriMeshData_build’ 内:
ode_trimesh.c:13931:225: 警告: 4 番目の ‘dGeomTriMeshDataBuildSimple’ の引数を渡すときのポインタの先の符号が異なります [-Wpointer-sign]
13931 | dGeomTriMeshDataBuildSimple(((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->tmdid,((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->vertex_buffer,__pyx_v_numverts,((struct __pyx_obj_3ode_TriMeshData *)__pyx_v_self)->face_buffer,(__pyx_v_numfaces * 3));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
| |
| int *
次のファイルから読み込み: /usr/include/ode/collision.h:1087:
/usr/include/ode/collision_trimesh.h:145:51: 備考: expected ‘const dTriIndex *’ {aka ‘const unsigned int *’} but argument is of type ‘int *’
145 | const dTriIndex* Indices, int IndexCount);
| ~~~~~~~~~~~~~~~~~^~~~~~~
ode_trimesh.c: 関数 ‘__pyx_f_3ode_15GeomHeightfield___cinit__’ 内:
ode_trimesh.c:14456:129: 警告: ポインタから異なるサイズの整数へのキャストです [-Wpointer-to-int-cast]
14456 | ((struct __pyx_obj_3ode_GeomHeightfield *)__pyx_v_self)->__pyx_base.gid = dCreateHeightfield(__pyx_v_sid,__pyx_v_data->hfdid,((int)__pyx_v_placeable));
| ^
gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 build/temp.linux-x86_64-2.7/ode_trimesh.o -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/usr/lib64 -lode -lstdc++ -lpython2.7 -o build/lib.linux-x86_64-2.7/ode.so -lode
/usr/bin/ld: 互換性のないを /usr/lib/libc.so スキップしました (-lc を探索している時)

■できたような、buildフォルダにできてます。
■pyODEのインストール
PyODE-snapshot-2010-03-22]$ sudo python setup.py install --record files.txt

INFO: found in /usr/include
INFO: ode_trimesh.c is up to date
INFO: ode_notrimesh.c is up to date
INFO: Installing with trimesh support.
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/ode.so -> /usr/lib64/python2.7/site-packages
running install_egg_info
Writing /usr/lib64/python2.7/site-packages/PyODE-1.2.0-py2.7.egg-info
writing list of installed files to 'files.txt'
[mac@mac-local PyODE-snapshot-2010-03-22]$

■cgkitでの確認
cgkit-2.0.0]$ cd utilities/
$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.18 (default, Aug 22 2022, 00:00:00)
[GCC 12.2.1 20220819 (Red Hat 12.2.1-1)]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0 (May 04 2020)
cgkit (C++ lib)............... OK
cgkit (all)................... OK
PyODEが入ってます。

■python cgkitで動作確認しました。
$ viewer.py newton-ball.py
Screenshot from 2022-12-31 13-12-10.png
ありがとうございます。
  • -
  • -

Linux Lite4.2 update and python cgkit error

■cgkit_sample $ viewer.py demo1.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/usr/local/bin/viewer.py", line 63, in
from cgkit.all import *
File "/usr/local/lib/python2.7/dist-packages/cgkit/all/__init__.py", line 46, in
from cgkit import _core
ImportError: libboost_python-py27.so.1.65.1: cannot open shared object file: No such file or directory

■cgkit_sample $ sudo ldconfig -p | grep libboost_python
libboost_python38.so.1.67.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.67.0
libboost_python38.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python38.so
libboost_python27.so.1.67.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python27.so.1.67.0
libboost_python27.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libboost_python27.so
■ cgkit_sample $ cd /usr/lib/x86_64-linux-gnu/
■ /usr/lib/x86_64-linux-gnu $ ls libboost*.*
libboost_date_time.so.1.71.0 libboost_python27.so.1.67.0
libboost_filesystem.so.1.71.0 libboost_python3-py38.a
libboost_iostreams.so.1.71.0 libboost_python3-py38.so
libboost_locale.so.1.71.0 libboost_python3.a
libboost_python.a libboost_python3.so
libboost_python.so libboost_python38.a
libboost_python2.so libboost_python38.so
libboost_python27.a libboost_python38.so.1.67.0
libboost_python27.so libboost_thread.so.1.71.0
■ /usr/lib/x86_64-linux-gnu $ sudo ln -s libboost_python27.so.1.67.0 libboost_python-py27.so.1.65.1
■ /usr/lib/x86_64-linux-gnu $ ls libboost*.*
libboost_date_time.so.1.71.0 libboost_python27.so.1.67.0
libboost_filesystem.so.1.71.0 libboost_python3-py38.a
libboost_iostreams.so.1.71.0 libboost_python3-py38.so
libboost_locale.so.1.71.0 libboost_python3.a
libboost_python-py27.so.1.65.1 libboost_python3.so
libboost_python.a libboost_python38.a
libboost_python.so libboost_python38.so
libboost_python2.so libboost_python38.so.1.67.0
libboost_python27.a libboost_thread.so.1.71.0
libboost_python27.so
■ /usr/lib/x86_64-linux-gnu $ sudo ldconfig

■cgkit_sample $ viewer.py demo3.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

■cgkit-2.0.0/utilities $ python checkenv.py
----------------------------------------------------------------------
Python 2.7.18 (default, Jul 1 2022, 12:27:04)
[GCC 9.4.0]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0 (Nov 26 2018)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

It works.
Thank you.
  • -
  • -

1/1