安装环境
Ubuntu 18.04 bionic
Python3.8.13
安装过程
使用以下命令,
pip install rosbag roslz4 ros_numpy std_msgs sensor_msgs geometry-msgs visualization-msgs actionlib-msgs nav_msgs tf2_msgs cv_bridge --extra-index-url https://rospypi.github.io/simple/
如果超时,可以多试几次。
本人机器安装的输出日志如下,
(py3813) pc@ubuntu1804_docker:~$ pip install rosbag roslz4 ros_numpy std_msgs sensor_msgs geometry-msgs visualization-msgs actionlib-msgs nav_msgs tf2_msgs cv_bridge --extra-index-url https://rospypi.github.io/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://rospypi.github.io/simple/
Collecting rosbag
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=15)")': /rospypi/simple/any/rosbag/rosbag-1.15.11-py2.py3-none-any.whl
Downloading https://github.com/rospypi/simple/raw/any/rosbag/rosbag-1.15.11-py2.py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.8/48.8 kB 320.9 kB/s eta 0:00:00
Collecting roslz4
Downloading https://github.com/rospypi/simple/raw/Linux_3.8/roslz4/roslz4-1.14.3.post2-cp38-cp38-linux_x86_64.whl (40 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 kB 141.3 kB/s eta 0:00:00
Collecting ros_numpy
Downloading https://github.com/rospypi/simple/raw/any/ros-numpy/ros_numpy-0.0.2-py2.py3-none-any.whl (8.5 kB)
Collecting std_msgs
Downloading https://github.com/rospypi/simple/raw/any/std-msgs/std_msgs-0.5.13.post0-py2.py3-none-any.whl (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.7/57.7 kB 20.1 kB/s eta 0:00:00
Collecting sensor_msgs
Downloading https://github.com/rospypi/simple/raw/any/sensor-msgs/sensor_msgs-1.13.0.post3-py2.py3-none-any.whl (78 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.7/78.7 kB 28.0 kB/s eta 0:00:00
Collecting geometry-msgs
Downloading https://github.com/rospypi/simple/raw/any/geometry-msgs/geometry_msgs-1.13.0.post2-py2.py3-none-any.whl (59 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.5/59.5 kB 35.9 kB/s eta 0:00:00
Collecting visualization-msgs
Downloading https://github.com/rospypi/simple/raw/any/visualization-msgs/visualization_msgs-1.13.0.post4-py2.py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.1/48.1 kB 17.2 kB/s eta 0:00:00
Collecting actionlib-msgs
Downloading https://github.com/rospypi/simple/raw/any/actionlib-msgs/actionlib_msgs-1.13.0.post3-py2.py3-none-any.whl (8.6 kB)
Collecting nav_msgs
Downloading https://github.com/rospypi/simple/raw/any/nav-msgs/nav_msgs-1.13.0.post3-py2.py3-none-any.whl (40 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.7/40.7 kB 28.3 kB/s eta 0:00:00
Collecting tf2_msgs
Downloading https://github.com/rospypi/simple/raw/any/tf2-msgs/tf2_msgs-0.7.2.post3-py2.py3-none-any.whl (26 kB)
Collecting cv_bridge
Downloading https://github.com/rospypi/simple/raw/any/cv-bridge/cv_bridge-1.13.0.post1-py2.py3-none-any.whl (6.1 kB)
Collecting genmsg (from rosbag)
Downloading https://github.com/rospypi/simple/raw/any/genmsg/genmsg-0.5.12-py2.py3-none-any.whl (25 kB)
Collecting genpy=1.2.1 (from gnupg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/af/4d/389441079ecef400e2551a3933224885a7bde6b8a4810091d628cdd75afe/psutil-5.9.5-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (282 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.1/282.1 kB 603.5 kB/s eta 0:00:00
Collecting catkin (from roslib->rosbag)
Downloading https://github.com/rospypi/simple/raw/any/catkin/catkin-0.7.18-py2.py3-none-any.whl (41 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.0/41.0 kB 36.1 kB/s eta 0:00:00
Collecting catkin-pkg (from rospkg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d7/52/a5395120c9a9a92837d7daf28c4fd26df50ed6e291244c70fef1a1caa5c2/catkin_pkg-0.5.2-py3-none-any.whl (76 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.1/76.1 kB 383.7 kB/s eta 0:00:00
Collecting PyYAML (from rospkg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d7/42/7ad4b6d67a16229496d4f6e74201bdbebcf4bc1e87d5a70c9297d4961bd2/PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 701.2/701.2 kB 1.1 MB/s eta 0:00:00
Collecting distro>=1.4.0 (from rospkg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f4/2c/c90a3adaf0ddb70afe193f5ebfb539612af57cffe677c3126be533df3098/distro-1.8.0-py3-none-any.whl (20 kB)
Requirement already satisfied: numpy in ./anaconda3/envs/py3813/lib/python3.8/site-packages (from rospy->rosbag) (1.23.3)
Collecting roscpp (from rospy->rosbag)
Downloading https://github.com/rospypi/simple/raw/any/roscpp/roscpp-1.15.11-py2.py3-none-any.whl (7.8 kB)
Collecting rosgraph (from rospy->rosbag)
Downloading https://github.com/rospypi/simple/raw/any/rosgraph/rosgraph-1.15.11-py2.py3-none-any.whl (37 kB)
Collecting rosgraph-msgs (from rospy->rosbag)
Downloading https://github.com/rospypi/simple/raw/any/rosgraph-msgs/rosgraph_msgs-1.11.3.post2-py2.py3-none-any.whl (7.9 kB)
Collecting docutils (from catkin-pkg->rospkg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/93/69/e391bd51bc08ed9141ecd899a0ddb61ab6465309f1eb470905c0c8868081/docutils-0.19-py3-none-any.whl (570 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 570.5/570.5 kB 2.9 MB/s eta 0:00:00
Collecting python-dateutil (from catkin-pkg->rospkg->rosbag)
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 3.9 MB/s eta 0:00:00
Requirement already satisfied: pyparsing in ./anaconda3/envs/py3813/lib/python3.8/site-packages (from catkin-pkg->rospkg->rosbag) (3.0.9)
Requirement already satisfied: setuptools in ./anaconda3/envs/py3813/lib/python3.8/site-packages (from catkin-pkg->rospkg->rosbag) (63.4.1)
Requirement already satisfied: six>=1.5 in ./anaconda3/envs/py3813/lib/python3.8/site-packages (from python-dateutil->catkin-pkg->rospkg->rosbag) (1.16.0)
Building wheels for collected packages: gnupg
Building wheel for gnupg (setup.py) ... done
Created wheel for gnupg: filename=gnupg-2.3.1-py3-none-any.whl size=94620 sha256=f0d349f12a9ec26afc040f1f1aca58e8675d904deb2152d879e2914837a318c5
Stored in directory: /home/pc/.cache/pip/wheels/ec/71/bd/c3f283785ce7e6e71ba8cc9a643912860ac9724661c000e012
Successfully built gnupg
Installing collected packages: sensor_msgs, roslz4, ros_numpy, genmsg, cv_bridge, catkin, PyYAML, python-dateutil, pycryptodomex, pycryptodome, psutil, genpy, docutils, distro, visualization-msgs, tf2_msgs, std_msgs, rosgraph-msgs, roscpp, nav_msgs, gnupg, geometry-msgs, catkin-pkg, actionlib-msgs, rospkg, roslib, rosgraph, rospy, rosbag
Successfully installed PyYAML-6.0 actionlib-msgs-1.13.0.post3 catkin-0.7.18 catkin-pkg-0.5.2 cv_bridge-1.13.0.post1 distro-1.8.0 docutils-0.19 genmsg-0.5.12 genpy-0.6.14 geometry-msgs-1.13.0.post2 gnupg-2.3.1 nav_msgs-1.13.0.post3 psutil-5.9.5 pycryptodome-3.17 pycryptodomex-3.17 python-dateutil-2.8.2 ros_numpy-0.0.2 rosbag-1.15.11 roscpp-1.15.11 rosgraph-1.15.11 rosgraph-msgs-1.11.3.post2 roslib-1.14.7.post0 roslz4-1.14.3.post2 rospkg-1.5.0 rospy-1.15.11 sensor_msgs-1.13.0.post3 std_msgs-0.5.13.post0 tf2_msgs-0.7.2.post3 visualization-msgs-1.13.0.post4
(py3813) pc@ubuntu1804_docker:~$
(py3813) pc@ubuntu1804_docker:~$ date
Sat Apr 29 21:16:53 CST 2023
(py3813) pc@ubuntu1804_docker:~$
参考文档
https://www.cnblogs.com/yunhgu/p/15785460.html
https://blog.csdn.net/heroacool/article/details/123138635