pptk
pptk copied to clipboard
How to build on Ubuntu 22.04 with Conda Python 3.9
It took me sometime to read through all issues and requests to make it work out, so I just wanted to place this here for documentation: The details are in the read me of forked repo https://github.com/austinvishal/pptk/tree/pptk_view
For Conda Users with Python 3.9 and Ubuntu 22.04 (To be precise Miniconda 24.7.1, Python 3.9.18, Ubuntu 22.04.4). Given below are the instructions
- Download the zip file from first comment 45 in the issue extract it.
- Rename 38 to 39 for your python3.9 version inside the extracted folder
or
Here is the wheel for convenience, just download, extract and proceed to step 3:
pptkcp39 - For installation inside conda environment activate your conda environment, go to the downloaded folder where extracted file is and type the command in the terminal
pip3 install ./pptk-0.1.0-cp39-none-manylinux1_x86_64.whl
will install the necessary libraries libraries
- Run an example given in the github as python file from terminal
Issues faced
Issue 1: ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
Solution:
a) Create sym link to have libpython3.8 library, for this create a new conda env with Py3.8 first
conda create -n test_env python=3.8
if you don't have python 3.8
b) Go to conda/envs/envname/lib/python3.9/site-packages/pptk/libs/libz.so and rename the libz.so file or cut it and paste it somewhere safe.
here we will use the symbolic link of libpython3.8.so file instead from the newly created conda environment with Py3.8
then we type the command based on the following syntax in the terminal
ln -s /home/{user_name}/anaconda3/envs/{env_name}/lib/libz.so.1 /home/{user_name}/anaconda3/envs/{env_name}/lib/python3.7/site-packages/pptk/libs/libz.so.1
Example in this case of symlink of shared libraries from legion environment with Py 3.8 to mujoco_py environment with Py 3.9:
ln -s /home/vishal/.miniconda3/envs/legion/lib/libz.so /home/vishal/.miniconda3/envs/mujoco_py/lib/python3.9/site-packages/pptk/libs/libz.so
ln -s /home/vishal/.miniconda3/envs/legion/lib/libpython3.8.so.1.0 /home/vishal/.miniconda3/envs/mujoco_py/lib/python3.9/site-packages/pptk/libs/libpython3.8.so.1.0
c) Now use the example given in the github and save it as pptkexample1.py to view 100 points as point cloud in the viewer and run the example in the terminal
python pptkexample1.py
Issue 2: The viewer pops up and closes
Solution:
After line 52 in viewer.py,
set debug=True
(temporary fix) based on, 24
Result of running the example is shown in the Readme of forked repo (Page Down) : https://github.com/austinvishal/pptk/tree/pptk_view
Done.