tomas789 / kitti2bag

Convert KITTI dataset to ROS bag file the easy way!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installing from source results in ModuleNotFoundError

thully opened this issue · comments

I tried to install kitti2bag from the source repository, using the setup.py script. While running "python setup.py install" seemed to work, running kitti2bag after that results in the following error:

Traceback (most recent call last):
File "/home/thully/anaconda3/bin/kitti2bag", line 11, in
load_entry_point('kitti2bag==1.5', 'console_scripts', 'kitti2bag')()
File "/home/thully/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/thully/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2793, in load_entry_point
return ep.load()
File "/home/thully/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2411, in load
return self.resolve()
File "/home/thully/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2417, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
ModuleNotFoundError: No module named 'kitti2bag'

I tried this with Python 2 as well as on a system without Anaconda installed, and get the same error. Installing using pip works, though isn't desired as I wanted to work on some potential enhancements to the script (in particular, handling tracklets)

I found it works (using Python 2) if I do "sudo -H pip install -e ." in the directory containing the source. However, if I leave out the -e, I get the following error:

Traceback (most recent call last):
File "/usr/local/bin/kitti2bag", line 7, in
from kitti2bag.main import main
ImportError: No module named kitti2bag.main

You are not installing it wrong. There's currently a minor bug in setup.py - the required packages=['kitti2bag'] parameter is missing and causes normal installation to fail. Installation in development mode with python setup.py develop or pip install -e . still works, somewhat misleadingly.
A fix for this included in #38.

I could successfully install kitti2bag from source using any of the following commands
sudo python setup.py develop
sudo python -m pip install -e .
sudo python setup.py install
(I tried them all) but I still get the following error when trying to execute
kitti2bag -t 2011_09_26 -r 0002 raw_synced .

Traceback (most recent call last):
File "/usr/local/bin/kitti2bag", line 11, in
load_entry_point('kitti2bag', 'console_scripts', 'kitti2bag')()
File "/home/mina/.local/lib/python2.7/site-packages/pkg_resources/init.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/mina/.local/lib/python2.7/site-packages/pkg_resources/init.py", line 2699, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'kitti2bag') not found

Any ideas what's happening?
(N.B I'm very unexperienced with pip)

ok I just got it to work by uninstalling pip and reinstalling it, then uninstalling kitti2bag using pip uninstall kitt2bag, then reinstalling it using pip install kitti2bag, and it works!