Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing from source results in ModuleNotFoundError #41

Open
thully opened this issue May 16, 2019 · 4 comments
Open

Installing from source results in ModuleNotFoundError #41

thully opened this issue May 16, 2019 · 4 comments

Comments

@thully
Copy link

thully commented May 16, 2019

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)

@thully
Copy link
Author

thully commented May 16, 2019

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

@valgur
Copy link
Collaborator

valgur commented May 16, 2019

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.

@MinaHenein
Copy link

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)

@MinaHenein
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants