OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.89k stars 1.11k forks source link

Running ./start-dev-env.sh throws multiple Import errors #1115

Closed SBCV closed 4 years ago

SBCV commented 4 years ago

How did you install OpenDroneMap?

I followed the steps in https://github.com/OpenDroneMap/ODM#developers, i.e.

What's your operating system?

OS: Ubuntu 18.04

What is the problem?

When executing the last step described under https://github.com/OpenDroneMap/ODM#developers (i.e. ./run.sh --project-path /datasets mydataset) I receive the following error message: ImportError: No module named cv2

I am able to fix this problem by manually installing OpenCV, i.e.

When I attach to the container again with docker attach <container_id> and execute (again) ./run.sh --project-path /datasets mydataset I receive: ImportError: No module named opensfm.large. Thus, I think something went wrong with the installation process.

Here is the log of DATA=/path/to/datasets ./start-dev-env.sh

Starting development environment...
Datasets path: /home/bullin/Desktop/empty
NodeODM port: 3000
QT Creator: NO
access control disabled, clients can connect from any host
Adding seb to /etc/passwd
Adding seb to /etc/group
su: Authentication failure
(Ignored)
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

###################################
ODM Dev Environment Ready. Hack on!
###################################

What should be the expected behavior?

Creating the same/similar results as executing docker run -ti --rm -v /datasets:/datasets opendronemap/odm --project-path /datasets project as described under https://github.com/OpenDroneMap/ODM#quickstart

How can we reproduce this?

Follow the steps at https://github.com/OpenDroneMap/ODM#developers

pierotofy commented 4 years ago

Mm, really strange; are you using the opendronemap/nodeodm docker image?

SBCV commented 4 years ago

Side note: The second last line of start-dev-env.sh contains docker run -ti --entrypoint bash --name odmdev -v $(pwd):/code -v "$DATA":/datasets -p $PORT:3000 --privileged -e DISPLAY -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" -v="$HOME/.odm-dev-home:/home/$USER" opendronemap/nodeodm -c "/code/start-dev-env.sh --setup $USER $USER_ID $GROUP_ID $QTC".

Note the docker image: opendronemap/nodeodm.

That looks a bit strange, since https://github.com/OpenDroneMap/ODM#quickstart uses opendronemap/odm. Does that still make sense?

pierotofy commented 4 years ago

Using opendronemap/nodeodm is expected (it's built from opendronemap/odm). The opencv error usually shows up if the PYTHONPATH is not properly set to point to the OpenSfM directory (https://github.com/OpenDroneMap/ODM/blob/master/Dockerfile#L69).

SBCV commented 4 years ago

Do I have to set that path by hand?

SBCV commented 4 years ago

Btw: /code/SuperBuild in the docker container contains only a CMakeLists.txt file and a cmake folder.

SBCV commented 4 years ago

Did I miss some steps maybe?

pierotofy commented 4 years ago

Ah, sorry, I think you need to issue:

bash configure.sh reinstall

From the dev environment. I think this is missing from the README (ups! Could you open a PR?).

SBCV commented 4 years ago

I'll check, if it works and open a PR

SBCV commented 4 years ago

Just to avoid any confusion: I've now deleted all docker containers with docker rm -vf $(docker ps -a -q) and images with docker rmi -f $(docker images -a -q)

And next I should execute (odmdev) [user:/code] master+* ± bash configure.sh reinstall before (odmdev) [user:/code] master+* ± ./run.sh --project-path /datasets mydataset?

pierotofy commented 4 years ago

Correct!

SBCV commented 4 years ago

Nice, that worked. Just one more question: Is it possible to change the data path set with DATA=/path/to/datasets ./start-dev-env.sh after executing (odmdev) [user:/code] master+* ± bash configure.sh reinstall? If not, we could add an additional note to the PR.

pierotofy commented 4 years ago

Mm, probably not; it involves mounting a docker volume, which requires the container to be restarted.

Note that you need to execute the bash configure.sh reinstall only the first time; the second time you launch the start-dev-env.sh script this is not needed.