1.按照官网的做法用docker安装
(docker指令和使用可参考)
docker run -v :/data -it tomas789/kitti2bag -t 2011_09_26 -r 0005 raw_synced
使用docker出现如下错误:
Traceback (most recent call last):
File "/usr/local/bin/kitti2bag", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 834, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.11.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('numpy>=1.12.0'), set(['pandas']))
暂未找到解决方案,所以暂时放弃这个方法
2.基于conda来安装
(conda指令请参考Conda使用教程 - 知乎)
conda create kitti
conda activate kitti
按照kitti2bag提示直接安装就可以了
pip install kitti2bag
但可惜安装完后执行kitti2bag指令就报错了:
'kitti2bag' 不是内部或外部命令,也不是可运行的程序或批处理文件。
好吧,那就检查一下环境变量,把所有跟kitti2bag相关的路径都配置到Path里面,然鹅没什么卵用。
现在怀疑安装出来的kitti2bag是缺损的,肯定也还缺少某些文件
3.网上查资料查呀查翻得我手都起茧了,终于找到了正确姿势
kitti2bag工具的安装_Maxen0604的博客-CSDN博客_kitti2bag:未找到命令
但在我执行
sudo pip install pandas==0.23.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
这一句直接报错,报错内容还挺长的
(kitti2) C:\Users\Wincent>pip install pandas==0.23.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
Collecting pandas==0.23.0
Downloading http://pypi.doubanio.com/packages/45/12/1e1ba99fb65df9f7f3724d3232feef35cc044d18604d57492d561e90219f/pandas-0.23.0.tar.gz (13.1 MB)
|████████████████████████████████| 13.1 MB 6.4 MB/s
Requirement already satisfied: python-dateutil>=2.5.0 in d:\program files\miniconda3\lib\site-packages (from pandas==0.23.0) (2.8.2)
Requirement already satisfied: pytz>=2011k in d:\program files\miniconda3\lib\site-packages (from pandas==0.23.0) (2021.1)
Requirement already satisfied: numpy>=1.9.0 in c:\users\wincent\appdata\roaming\python\python39\site-packages (from pandas==0.23.0) (1.23.0)
Requirement already satisfied: six>=1.5 in d:\program files\miniconda3\lib\site-packages (from python-dateutil>=2.5.0->pandas==0.23.0) (1.15.0)
Building wheels for collected packages: pandas
Building wheel for pandas (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'D:\Program Files\miniconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Wincent\\AppData\\Local\\Temp\\pip-install-adrp64f9\\pandas_a3c13137fb3a461d92861e57fc34c0e7\\setup.py'"'"'; __file__='"'"'C:\\Users\\Wincent\\AppData\\Local\\Temp\\pip-install-adrp64f9\\pandas_a3c13137fb3a461d92861e57fc34c0e7\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Wincent\AppData\Local\Temp\pip-wheel-794mpyou'
cwd: C:\Users\Wincent\AppData\Local\Temp\pip-install-adrp64f9\pandas_a3c13137fb3a461d92861e57fc34c0e7\
Complete output (1020 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pandas
copying pandas\conftest.py -> build\lib.win-amd64-3.9\pandas
copying pandas\json.py -> build\lib.win-amd64-3.9\pandas
copying pandas\lib.py -> build\lib.win-amd64-3.9\pandas
copying pandas\parser.py -> build\lib.win-amd64-3.9\pandas
copying pandas\testing.py -> build\lib.win-amd64-3.9\pandas
copying pandas\tslib.py -> build\lib.win-amd64-3.9\pandas
copying pandas\_version.py -> build\lib.win-amd64-3.9\pandas
copying pandas\__init__.py -> build\lib.win-amd64-3.9\pandas
creating build\lib.win-amd64-3.9\pandas\api
copying pandas\api\__init__.py -> build\lib.win-amd64-3.9\pandas\api
creating build\lib.win-amd64-3.9\pandas\compat
copying pandas\compat\chainmap.py -> build\lib.win-amd64-3.9\pandas\compat
copying pandas\compat\chainmap_impl.py -> build\lib.win-amd64-3.9\pandas\compat
copying pandas\compat\pickle_compat.py -> build\lib.win-amd64-3.9\pandas\compat
copying pandas\compat\__init__.py -> build\lib.win-amd64-3.9\pandas\compat
creating build\lib.win-amd64-3.9\pandas\computation
copying pandas\computation\expressions.py -> build\lib.win-amd64-3.9\pandas\computation
copying pandas\computation\__init__.py -> build\lib.win-amd64-3.9\pandas\computation
creating build\lib.win-amd64-3.9\pandas\core
copying pandas\core\accessor.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\algorithms.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\api.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\apply.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\base.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\categorical.py -> build\lib.win-amd64-3.9\pandas\core
copying pandas\core\common.py -> build\lib.win-amd64-3.9\pandas\core
...
...中间省略三万字
...
copying pandas\tests\io\sas\data\test_12659.csv -> build\lib.win-amd64-3.9\pandas\tests\io\sas\data
copying pandas\tests\io\sas\data\test_12659.sas7bdat -> build\lib.win-amd64-3.9\pandas\tests\io\sas\data
copying pandas\tests\io\sas\data\test_sas7bdat_1.csv -> build\lib.win-amd64-3.9\pandas\tests\io\sas\data
copying pandas\tests\io\sas\data\test_sas7bdat_2.csv -> build\lib.win-amd64-3.9\pandas\tests\io\sas\data
copying pandas\tests\io\sas\data\zero_variables.sas7bdat -> build\lib.win-amd64-3.9\pandas\tests\io\sas\data
creating build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\allow_exact_matches.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\allow_exact_matches_and_tolerance.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\asof.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\asof2.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\quotes.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\quotes2.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\tolerance.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\trades.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
copying pandas\tests\reshape\merge\data\trades2.csv -> build\lib.win-amd64-3.9\pandas\tests\reshape\merge\data
creating build\lib.win-amd64-3.9\pandas\tests\tseries\offsets\data
copying pandas\tests\tseries\offsets\data\cday-0.14.1.pickle -> build\lib.win-amd64-3.9\pandas\tests\tseries\offsets\data
copying pandas\tests\tseries\offsets\data\dateoffset_0_15_2.pickle -> build\lib.win-amd64-3.9\pandas\tests\tseries\offsets\data
UPDATING build\lib.win-amd64-3.9\pandas/_version.py
set build\lib.win-amd64-3.9\pandas/_version.py to '0.23.0'
running build_ext
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Wincent\AppData\Local\Temp\pip-install-adrp64f9\pandas_a3c13137fb3a461d92861e57fc34c0e7\setup.py", line 732, in
setup(name=DISTNAME,
File "D:\Program Files\miniconda3\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "D:\Program Files\miniconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Program Files\miniconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Program Files\miniconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Program Files\miniconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\Program Files\miniconda3\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "D:\Program Files\miniconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Program Files\miniconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Program Files\miniconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\Program Files\miniconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Program Files\miniconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Program Files\miniconda3\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\Wincent\AppData\Local\Temp\pip-install-adrp64f9\pandas_a3c13137fb3a461d92861e57fc34c0e7\setup.py", line 376, in build_extensions
self.check_cython_extensions(self.extensions)
File "C:\Users\Wincent\AppData\Local\Temp\pip-install-adrp64f9\pandas_a3c13137fb3a461d92861e57fc34c0e7\setup.py", line 370, in check_cython_extensions
raise Exception("""Cython-generated file '{src}' not found.
Exception: Cython-generated file 'pandas\_libs/algos.c' not found.
Cython is required to compile pandas from a development branch.
Please install Cython or download a release package of pandas.
pandas._libs.algos: -> [['pandas\\_libs/algos.c']]
----------------------------------------
Rolling back uninstall of pandas
Moving to d:\program files\miniconda3\lib\site-packages\pandas-1.3.2.dist-info\
from D:\Program Files\miniconda3\Lib\site-packages\~andas-1.3.2.dist-info
Moving to d:\program files\miniconda3\lib\site-packages\pandas\
from D:\Program Files\miniconda3\Lib\site-packages\~andas
ERROR: Command errored out with exit status 1: 'D:\Program Files\miniconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Wincent\\AppData\\Local\\Temp\\pip-install-adrp64f9\\pandas_a3c13137fb3a461d92861e57fc34c0e7\\setup.py'"'"'; __file__='"'"'C:\\Users\\Wincent\\AppData\\Local\\Temp\\pip-install-adrp64f9\\pandas_a3c13137fb3a461d92861e57fc34c0e7\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Wincent\AppData\Local\Temp\pip-record-wrl18ym0\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Program Files\miniconda3\Include\pandas' Check the logs for full command output.
于是尝试了使用conda install, 它与pip install最大的区别在于conda install 会更全面检查兼容性
详细区别请参考 conda install和pip install的区别_安安爸Chris的博客-CSDN博客_conda install和pip的区别
4.安装pykitti
pip install pykitti
但是安装完后测试下pykitti竟然还报错
测试语句:python -m pykitti
Traceback (most recent call last):
File "D:\anaconda3\envs\kitti\lib\runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "D:\anaconda3\envs\kitti\lib\runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "D:\anaconda3\envs\kitti\lib\site-packages\pykitti\__init__.py", line 3, in
from pykitti.odometry import odometry
File "D:\anaconda3\envs\kitti\lib\site-packages\pykitti\odometry.py", line 8, in
import numpy as np
File "D:\anaconda3\envs\kitti\lib\site-packages\numpy\__init__.py", line 142, in
from . import add_newdocs
File "D:\anaconda3\envs\kitti\lib\site-packages\numpy\add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "D:\anaconda3\envs\kitti\lib\site-packages\numpy\lib\__init__.py", line 8, in
from .type_check import *
File "D:\anaconda3\envs\kitti\lib\site-packages\numpy\lib\type_check.py", line 11, in
import numpy.core.numeric as _nx
File "D:\anaconda3\envs\kitti\lib\site-packages\numpy\core\__init__.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: 找不到指定的模块。
解决办法:
可能是numpy版本不对,毕竟kitti2bag工具出了那么多年,很多包都是基于当年2018年的版本来设置,所以找回2018年对应的numpy版本
pip install -U numpy==1.13
参考:
Numpy的版本查看、降级(自定版本下载)
5.安装完对应版本的numpy再测试一下pykitti, 依然报错
(kitti) C:\Users\Wincent>python -m pykitti
Traceback (most recent call last):
File "D:\anaconda3\envs\kitti\lib\runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "D:\anaconda3\envs\kitti\lib\runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "D:\anaconda3\envs\kitti\lib\site-packages\pykitti\__init__.py", line 5, in
from pykitti.tracking import tracking
File "D:\anaconda3\envs\kitti\lib\site-packages\pykitti\tracking.py", line 12, in
import cv2
ImportError: No module named cv2
需要安装opencv-python,还是取回2018年的版本
如果冒昧装个opencv 2.x还会报错
ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.1 (from versions: 3.1.0.0, 3.1.0.5, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18, 3.4.4.19, 3.4.5.20, 3.4.6.27, 3.4.7.28, 3.4.8.29, 3.4.9.31, 3.4.10.37, 4.0.0.21, 4.0.1.23, 4.0.1.24, 4.1.0.25, 4.1.1.26, 4.1.2.30, 4.2.0.32, 4.3.0.38)
根据cv历史版本信息
OpenCV历史版本 选定2018版本3.4.1.15
pip install opencv-python==3.4.1.15
最后试下pykitti没有出错证明可以了
安装kitti2bag
pip install kitti2bag
之后测试python -m kitti2bag
还是报错
kitti2bag 不是内部或外部命令,也不是可运行的程序
这就纳闷了,环境变量都配置好了,参考这个
解决:‘conda‘ 不是内部或外部命令,也不是可运行的程序_weixin_53939670的博客-CSDN博客_conda不是内部或外部命令也不是可运行如果你有标题所说问题,请详细看以下步骤:1.找到Anaconda的Scripts文件夹路径,Anaconda安装在D:\Anaconda,所以对应的路径就是:D:\Anaconda\Scripts,复制该路径2.点击“我的电脑”右键属性--高级系统设置 --环境变量(右下角)3.系统变量--path--编辑4.新建--将找到的路径输入进去5.确定--win+r--cmd--在文本框里输入conda --version就可以啦!!...https://blog.csdn.net/weixin_53939670/article/details/124025269ktti2bag命名就在环境变量指定的路径里面,但无论我如何更改文件名为kitti2bag.py它就是不运行
看来得用大招,直接上spyder/jupyter notebook来运行它
但是偏偏在此刻网络非常卡顿安装不了spyder和notebook
7.再次回到kitti2bag的github网站,想再看看到底有没有漏了哪些细节
果真,题目写着:“要在ROS环境下完成”(论审题的重要性啊!)
于是想起去年搭建了一个ROS环境的UBUNTU就在电脑的第二系统
最终我切换了系统,作最后的尝试
虽然遇到两个错误,一个安装pip的错误,一个是rqt_bag指令运行错误,但最终都轻易解决,
(参考:
在执行rqt_bag指令报错
ubuntu下载PIP失败
)
如愿以偿,让我看到最终的画面,辛苦了1个月都在调试,看到了最终Kitti2bag跑起来的画面,那种感觉无比兴奋阿!