- make it to be a install_pykdl.sh
$ python -c "import PyKDL"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyKDL'-
https://github.com/orocos/orocos_kinematics_dynamics/blob/master/python_orocos_kdl/INSTALL.md
-
Problems: existing method will only lead to installation with default Python
$ locate PyKDL.so /usr/local/lib/python3/dist-packages/PyKDL.so
use
testas targeted conda environment
-
check env location
$ conda activate test # or source activate test $ python -c "import site; print(''.join(site.getsitepackages()))" /home/he/miniconda3/envs/test/lib/python3.8/site-packages
As a result, the targeted package installation path:
/home/he/miniconda3/envs/test/lib/python3.8/site-packages -
Follow the guide until step 5
- Clone the repository where you want
- Initialize the PyBind11 submodule:
git submodule update --init - Follow the mandatory instruction to compile the C++ library from orocos_kdl/INSTALL.md
- Create a new build folder (it is always better not to build in the source folder):
mkdir build - Go to the build folder
cd build
# step1 git clone https://github.com/hibetterheyj/orocos_kinematics_dynamics.git # step2 cd orocos_kinematics_dynamics git submodule update --init # step3 sudo apt-get update sudo apt-get install libeigen3-dev libcppunit-dev sudo apt-get install python3-psutil python3-future # step4&5 cd python_orocos_kdl mkdir build cd build
-
Execute cmake with specific python environment
-
DPYTHON_EXECUTABLE=/home/he/miniconda3/envs/test/bin/python -
DPYTHON_INCLUDE_DIR=/home/he/miniconda3/envs/test/include/python3.8 -
DCMAKE_INSTALL_PREFIX=/home/he/miniconda3/envs/test
$ pip install empy $ cmake build \ -DPYTHON_EXECUTABLE=/home/he/miniconda3/envs/test/bin/python3.8 \ -DPYTHON_INCLUDE_DIR=/home/he/miniconda3/envs/test/include/python3.8 \ -DCMAKE_INSTALL_PREFIX=/home/he/miniconda3/envs/test \ -ROS_PYTHON_VERSION=3 \ .. $ make $ sudo make install
-
-
Finals
-
Add
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libinto.bashrc -
Execute ldconfig:
sudo ldconfig -
check
PyKDLinstallation$ python -c "import PyKDL; print(PyKDL.Vector(1,2,3))" [ 1, 2, 3]
-